From 8e1a2b97df4996ed9e1fdbe37377ec2ceb1aa2dd Mon Sep 17 00:00:00 2001 From: "djm@kirby.fc.hp.com" Date: Thu, 1 Sep 2005 12:46:28 -0600 Subject: [PATCH] Final changes for linux 2.6.13 rebasing and some directory reorgs --- xen/arch/ia64/Makefile | 15 +- xen/arch/ia64/linux/README.origin | 19 +- xen/arch/ia64/linux/{lib => }/bitop.c | 0 xen/arch/ia64/linux/{lib => }/clear_page.S | 0 xen/arch/ia64/linux/{lib => }/copy_page_mck.S | 0 xen/arch/ia64/linux/{lib => }/flush.S | 0 xen/arch/ia64/linux/{lib => }/idiv32.S | 0 xen/arch/ia64/linux/{lib => }/idiv64.S | 0 xen/arch/ia64/linux/{lib => }/memcpy_mck.S | 0 xen/arch/ia64/linux/{lib => }/memset.S | 0 xen/arch/ia64/linux/{lib => }/strlen.S | 0 xen/arch/ia64/{ => vmx}/mm.c | 0 xen/arch/ia64/{ => vmx}/mmio.c | 0 xen/arch/ia64/{ => vmx}/pal_emul.c | 0 xen/arch/ia64/{ => vmx}/vlsapic.c | 0 xen/arch/ia64/{ => vmx}/vmmu.c | 0 xen/arch/ia64/{ => vmx}/vmx_entry.S | 0 xen/arch/ia64/{ => vmx}/vmx_hypercall.c | 0 xen/arch/ia64/{ => vmx}/vmx_init.c | 0 xen/arch/ia64/{ => vmx}/vmx_interrupt.c | 0 xen/arch/ia64/{ => vmx}/vmx_irq_ia64.c | 0 xen/arch/ia64/{ => vmx}/vmx_ivt.S | 0 xen/arch/ia64/{ => vmx}/vmx_minstate.h | 0 xen/arch/ia64/{ => vmx}/vmx_phy_mode.c | 0 xen/arch/ia64/{ => vmx}/vmx_process.c | 0 xen/arch/ia64/{ => vmx}/vmx_support.c | 0 xen/arch/ia64/{ => vmx}/vmx_utility.c | 0 xen/arch/ia64/{ => vmx}/vmx_vcpu.c | 0 xen/arch/ia64/{ => vmx}/vmx_virt.c | 0 xen/arch/ia64/{ => vmx}/vmx_vsa.S | 0 xen/arch/ia64/{ => vmx}/vtlb.c | 0 xen/arch/ia64/{ => xen}/acpi.c | 0 xen/arch/ia64/{ => xen}/dom0_ops.c | 0 xen/arch/ia64/{ => xen}/dom_fw.c | 0 xen/arch/ia64/{ => xen}/domain.c | 0 xen/arch/ia64/{ => xen}/grant_table.c | 0 xen/arch/ia64/{ => xen}/hpsimserial.c | 0 xen/arch/ia64/{ => xen}/hypercall.c | 0 xen/arch/ia64/{ => xen}/hyperprivop.S | 0 xen/arch/ia64/{ => xen}/idle0_task.c | 0 xen/arch/ia64/{ => xen}/irq.c | 0 xen/arch/ia64/{ => xen}/ivt.S | 0 xen/arch/ia64/{ => xen}/mm_init.c | 2 + xen/arch/ia64/{ => xen}/pcdp.c | 0 xen/arch/ia64/{ => xen}/privop.c | 0 xen/arch/ia64/{ => xen}/process.c | 0 xen/arch/ia64/{ => xen}/regionreg.c | 0 xen/arch/ia64/{ => xen}/sn_console.c | 0 xen/arch/ia64/{ => xen}/vcpu.c | 0 xen/arch/ia64/{ => xen}/vhpt.c | 0 xen/arch/ia64/{ => xen}/xen.lds.S | 0 xen/arch/ia64/{ => xen}/xenasm.S | 0 xen/arch/ia64/{ => xen}/xenirq.c | 1 + xen/arch/ia64/{ => xen}/xenmem.c | 0 xen/arch/ia64/{ => xen}/xenmisc.c | 2 +- xen/arch/ia64/{ => xen}/xensetup.c | 0 xen/arch/ia64/{ => xen}/xentime.c | 0 xen/include/asm-ia64/config.h | 8 +- .../{linux => linux-xen}/asm/pgtable.h | 66 +++--- xen/include/asm-ia64/linux/asm-generic/bug.h | 22 +- .../asm-ia64/linux/asm-generic/errno.h | 4 + .../asm-ia64/linux/asm-generic/iomap.h | 5 + xen/include/asm-ia64/linux/asm-generic/pci.h | 8 + .../linux/asm-generic/pgtable-nopud.h | 5 + .../asm-ia64/linux/asm-generic/pgtable.h | 151 +++++++++---- .../asm-ia64/linux/asm-generic/sections.h | 3 + .../asm-ia64/linux/asm-generic/topology.h | 9 +- .../asm-ia64/linux/asm-generic/unaligned.h | 122 +++++++++++ .../asm-ia64/linux/asm-generic/vmlinux.lds.h | 2 +- xen/include/asm-ia64/linux/asm/acpi.h | 9 + xen/include/asm-ia64/linux/asm/bitops.h | 27 ++- xen/include/asm-ia64/linux/asm/break.h | 2 + xen/include/asm-ia64/linux/asm/bug.h | 5 +- xen/include/asm-ia64/linux/asm/cacheflush.h | 2 +- xen/include/asm-ia64/linux/asm/numnodes.h | 15 ++ xen/include/asm-ia64/linux/asm/param.h | 2 +- xen/include/asm-ia64/linux/asm/pci.h | 31 ++- xen/include/asm-ia64/linux/asm/percpu.h | 2 +- xen/include/asm-ia64/linux/asm/sections.h | 1 + xen/include/asm-ia64/linux/asm/signal.h | 21 +- xen/include/asm-ia64/linux/asm/smp.h | 52 +++-- xen/include/asm-ia64/linux/asm/thread_info.h | 2 +- xen/include/asm-ia64/linux/asm/topology.h | 66 ++++-- xen/include/asm-ia64/linux/asm/unaligned.h | 117 +--------- xen/include/asm-ia64/linux/asm/unistd.h | 8 +- xen/include/asm-ia64/linux/bitmap.h | 8 +- xen/include/asm-ia64/linux/bitops.h | 22 ++ xen/include/asm-ia64/linux/dma-mapping.h | 5 + xen/include/asm-ia64/linux/efi.h | 3 +- xen/include/asm-ia64/linux/err.h | 4 +- xen/include/asm-ia64/linux/gfp.h | 54 +++-- xen/include/asm-ia64/linux/mmzone.h | 203 ++++++++++++++++-- xen/include/asm-ia64/linux/numa.h | 2 +- xen/include/asm-ia64/linux/page-flags.h | 37 ++-- xen/include/asm-ia64/linux/slab.h | 140 +++++++++++- xen/include/asm-ia64/linux/threads.h | 7 +- .../asm-ia64/linux/{linuxtime.h => time.h} | 0 xen/include/asm-ia64/linux/timex.h | 2 - xen/include/asm-ia64/linux/topology.h | 19 +- xen/include/asm-ia64/linux/wait.h | 82 +++++-- xen/include/asm-ia64/mm.h | 2 + xen/include/asm-ia64/time.h | 2 +- 102 files changed, 1025 insertions(+), 373 deletions(-) rename xen/arch/ia64/linux/{lib => }/bitop.c (100%) rename xen/arch/ia64/linux/{lib => }/clear_page.S (100%) rename xen/arch/ia64/linux/{lib => }/copy_page_mck.S (100%) rename xen/arch/ia64/linux/{lib => }/flush.S (100%) rename xen/arch/ia64/linux/{lib => }/idiv32.S (100%) rename xen/arch/ia64/linux/{lib => }/idiv64.S (100%) rename xen/arch/ia64/linux/{lib => }/memcpy_mck.S (100%) rename xen/arch/ia64/linux/{lib => }/memset.S (100%) rename xen/arch/ia64/linux/{lib => }/strlen.S (100%) rename xen/arch/ia64/{ => vmx}/mm.c (100%) rename xen/arch/ia64/{ => vmx}/mmio.c (100%) rename xen/arch/ia64/{ => vmx}/pal_emul.c (100%) rename xen/arch/ia64/{ => vmx}/vlsapic.c (100%) rename xen/arch/ia64/{ => vmx}/vmmu.c (100%) rename xen/arch/ia64/{ => vmx}/vmx_entry.S (100%) rename xen/arch/ia64/{ => vmx}/vmx_hypercall.c (100%) rename xen/arch/ia64/{ => vmx}/vmx_init.c (100%) rename xen/arch/ia64/{ => vmx}/vmx_interrupt.c (100%) rename xen/arch/ia64/{ => vmx}/vmx_irq_ia64.c (100%) rename xen/arch/ia64/{ => vmx}/vmx_ivt.S (100%) rename xen/arch/ia64/{ => vmx}/vmx_minstate.h (100%) rename xen/arch/ia64/{ => vmx}/vmx_phy_mode.c (100%) rename xen/arch/ia64/{ => vmx}/vmx_process.c (100%) rename xen/arch/ia64/{ => vmx}/vmx_support.c (100%) rename xen/arch/ia64/{ => vmx}/vmx_utility.c (100%) rename xen/arch/ia64/{ => vmx}/vmx_vcpu.c (100%) rename xen/arch/ia64/{ => vmx}/vmx_virt.c (100%) rename xen/arch/ia64/{ => vmx}/vmx_vsa.S (100%) rename xen/arch/ia64/{ => vmx}/vtlb.c (100%) rename xen/arch/ia64/{ => xen}/acpi.c (100%) rename xen/arch/ia64/{ => xen}/dom0_ops.c (100%) rename xen/arch/ia64/{ => xen}/dom_fw.c (100%) rename xen/arch/ia64/{ => xen}/domain.c (100%) rename xen/arch/ia64/{ => xen}/grant_table.c (100%) rename xen/arch/ia64/{ => xen}/hpsimserial.c (100%) rename xen/arch/ia64/{ => xen}/hypercall.c (100%) rename xen/arch/ia64/{ => xen}/hyperprivop.S (100%) rename xen/arch/ia64/{ => xen}/idle0_task.c (100%) rename xen/arch/ia64/{ => xen}/irq.c (100%) rename xen/arch/ia64/{ => xen}/ivt.S (100%) rename xen/arch/ia64/{ => xen}/mm_init.c (99%) rename xen/arch/ia64/{ => xen}/pcdp.c (100%) rename xen/arch/ia64/{ => xen}/privop.c (100%) rename xen/arch/ia64/{ => xen}/process.c (100%) rename xen/arch/ia64/{ => xen}/regionreg.c (100%) rename xen/arch/ia64/{ => xen}/sn_console.c (100%) rename xen/arch/ia64/{ => xen}/vcpu.c (100%) rename xen/arch/ia64/{ => xen}/vhpt.c (100%) rename xen/arch/ia64/{ => xen}/xen.lds.S (100%) rename xen/arch/ia64/{ => xen}/xenasm.S (100%) rename xen/arch/ia64/{ => xen}/xenirq.c (98%) rename xen/arch/ia64/{ => xen}/xenmem.c (100%) rename xen/arch/ia64/{ => xen}/xenmisc.c (99%) rename xen/arch/ia64/{ => xen}/xensetup.c (100%) rename xen/arch/ia64/{ => xen}/xentime.c (100%) rename xen/include/asm-ia64/{linux => linux-xen}/asm/pgtable.h (92%) create mode 100644 xen/include/asm-ia64/linux/asm-generic/unaligned.h create mode 100644 xen/include/asm-ia64/linux/asm/numnodes.h rename xen/include/asm-ia64/linux/{linuxtime.h => time.h} (100%) diff --git a/xen/arch/ia64/Makefile b/xen/arch/ia64/Makefile index c3d03398b8..60e31a170c 100644 --- a/xen/arch/ia64/Makefile +++ b/xen/arch/ia64/Makefile @@ -1,9 +1,6 @@ include $(BASEDIR)/Rules.mk -VPATH = linux linux-xen linux/lib -#VPATH = linux-xen linux/lib - -# libs-y += arch/ia64/lib/lib.a +VPATH = xen vmx linux linux-xen OBJS = xensetup.o setup.o time.o irq.o ia64_ksyms.o process.o smp.o \ xenmisc.o acpi.o hypercall.o \ @@ -15,8 +12,6 @@ OBJS = xensetup.o setup.o time.o irq.o ia64_ksyms.o process.o smp.o \ irq_ia64.o irq_lsapic.o vhpt.o xenasm.o hyperprivop.o dom_fw.o \ grant_table.o sn_console.o -#OBJS += idiv64.o idiv32.o \ - # TMP holder to contain *.0 moved out of CONFIG_VTI OBJS += vmx_init.o @@ -27,7 +22,7 @@ OBJS += vmx_virt.o vmx_vcpu.o vmx_process.o vmx_vsa.o vmx_ivt.o\ pal_emul.o vmx_irq_ia64.o endif -# files from xen/arch/ia64/linux/lib (linux/arch/ia64/lib) +# lib files from xen/arch/ia64/linux/ (linux/arch/ia64/lib) OBJS += bitop.o clear_page.o flush.o copy_page_mck.o \ memset.o strlen.o memcpy_mck.o \ __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o \ @@ -86,9 +81,9 @@ $(BASEDIR)/include/asm-ia64/.offsets.h.stamp: touch $@ # I'm sure a Makefile wizard would know a better way to do this -xen.lds.s: xen.lds.S +xen.lds.s: xen/xen.lds.S $(CC) -E $(CPPFLAGS) -P -DXEN -D__ASSEMBLY__ \ - -o xen.lds.s xen.lds.S + -o xen.lds.s xen/xen.lds.S # variants of divide/modulo # see files in xen/arch/ia64/linux/lib (linux/arch/ia64/lib) @@ -111,7 +106,7 @@ __umodsi3.o: idiv32.S clean: - rm -f *.o *~ core xen.lds.s $(BASEDIR)/include/asm-ia64/.offsets.h.stamp asm-offsets.s + rm -f *.o *~ core xen.lds.s $(BASEDIR)/include/asm-ia64/.offsets.h.stamp asm-offsets.s map.out rm -f asm-xsi-offsets.s $(BASEDIR)/include/asm-ia64/asm-xsi-offsets.h rm -f linux/lib/*.o diff --git a/xen/arch/ia64/linux/README.origin b/xen/arch/ia64/linux/README.origin index e4ddbca01a..2dceb999f2 100644 --- a/xen/arch/ia64/linux/README.origin +++ b/xen/arch/ia64/linux/README.origin @@ -13,12 +13,13 @@ linuxextable.c -> linux/kernel/extable.c machvec.c -> linux/arch/ia64/kernel/machvec.c patch.c -> linux/arch/ia64/kernel/patch.c pcdp.h -> drivers/firmware/pcdp.h -lib/bitop.c -> linux/arch/ia64/lib/bitop.c -lib/clear_page.S -> linux/arch/ia64/lib/clear_page.S -lib/copy_page_mck.S -> linux/arch/ia64/lib/copy_page_mck.S -lib/flush.S -> linux/arch/ia64/lib/flush.S -lib/idiv32.S -> linux/arch/ia64/lib/idiv32.S -lib/idiv64.S -> linux/arch/ia64/lib/idiv64.S -lib/memcpy_mck.S -> linux/arch/ia64/lib/memcpy_mck.S -lib/memset.S -> linux/arch/ia64/lib/memset.S -lib/strlen.S -> linux/arch/ia64/lib/strlen.S + +bitop.c -> linux/arch/ia64/lib/bitop.c +clear_page.S -> linux/arch/ia64/lib/clear_page.S +copy_page_mck.S -> linux/arch/ia64/lib/copy_page_mck.S +flush.S -> linux/arch/ia64/lib/flush.S +idiv32.S -> linux/arch/ia64/lib/idiv32.S +idiv64.S -> linux/arch/ia64/lib/idiv64.S +memcpy_mck.S -> linux/arch/ia64/lib/memcpy_mck.S +memset.S -> linux/arch/ia64/lib/memset.S +strlen.S -> linux/arch/ia64/lib/strlen.S diff --git a/xen/arch/ia64/linux/lib/bitop.c b/xen/arch/ia64/linux/bitop.c similarity index 100% rename from xen/arch/ia64/linux/lib/bitop.c rename to xen/arch/ia64/linux/bitop.c diff --git a/xen/arch/ia64/linux/lib/clear_page.S b/xen/arch/ia64/linux/clear_page.S similarity index 100% rename from xen/arch/ia64/linux/lib/clear_page.S rename to xen/arch/ia64/linux/clear_page.S diff --git a/xen/arch/ia64/linux/lib/copy_page_mck.S b/xen/arch/ia64/linux/copy_page_mck.S similarity index 100% rename from xen/arch/ia64/linux/lib/copy_page_mck.S rename to xen/arch/ia64/linux/copy_page_mck.S diff --git a/xen/arch/ia64/linux/lib/flush.S b/xen/arch/ia64/linux/flush.S similarity index 100% rename from xen/arch/ia64/linux/lib/flush.S rename to xen/arch/ia64/linux/flush.S diff --git a/xen/arch/ia64/linux/lib/idiv32.S b/xen/arch/ia64/linux/idiv32.S similarity index 100% rename from xen/arch/ia64/linux/lib/idiv32.S rename to xen/arch/ia64/linux/idiv32.S diff --git a/xen/arch/ia64/linux/lib/idiv64.S b/xen/arch/ia64/linux/idiv64.S similarity index 100% rename from xen/arch/ia64/linux/lib/idiv64.S rename to xen/arch/ia64/linux/idiv64.S diff --git a/xen/arch/ia64/linux/lib/memcpy_mck.S b/xen/arch/ia64/linux/memcpy_mck.S similarity index 100% rename from xen/arch/ia64/linux/lib/memcpy_mck.S rename to xen/arch/ia64/linux/memcpy_mck.S diff --git a/xen/arch/ia64/linux/lib/memset.S b/xen/arch/ia64/linux/memset.S similarity index 100% rename from xen/arch/ia64/linux/lib/memset.S rename to xen/arch/ia64/linux/memset.S diff --git a/xen/arch/ia64/linux/lib/strlen.S b/xen/arch/ia64/linux/strlen.S similarity index 100% rename from xen/arch/ia64/linux/lib/strlen.S rename to xen/arch/ia64/linux/strlen.S diff --git a/xen/arch/ia64/mm.c b/xen/arch/ia64/vmx/mm.c similarity index 100% rename from xen/arch/ia64/mm.c rename to xen/arch/ia64/vmx/mm.c diff --git a/xen/arch/ia64/mmio.c b/xen/arch/ia64/vmx/mmio.c similarity index 100% rename from xen/arch/ia64/mmio.c rename to xen/arch/ia64/vmx/mmio.c diff --git a/xen/arch/ia64/pal_emul.c b/xen/arch/ia64/vmx/pal_emul.c similarity index 100% rename from xen/arch/ia64/pal_emul.c rename to xen/arch/ia64/vmx/pal_emul.c diff --git a/xen/arch/ia64/vlsapic.c b/xen/arch/ia64/vmx/vlsapic.c similarity index 100% rename from xen/arch/ia64/vlsapic.c rename to xen/arch/ia64/vmx/vlsapic.c diff --git a/xen/arch/ia64/vmmu.c b/xen/arch/ia64/vmx/vmmu.c similarity index 100% rename from xen/arch/ia64/vmmu.c rename to xen/arch/ia64/vmx/vmmu.c diff --git a/xen/arch/ia64/vmx_entry.S b/xen/arch/ia64/vmx/vmx_entry.S similarity index 100% rename from xen/arch/ia64/vmx_entry.S rename to xen/arch/ia64/vmx/vmx_entry.S diff --git a/xen/arch/ia64/vmx_hypercall.c b/xen/arch/ia64/vmx/vmx_hypercall.c similarity index 100% rename from xen/arch/ia64/vmx_hypercall.c rename to xen/arch/ia64/vmx/vmx_hypercall.c diff --git a/xen/arch/ia64/vmx_init.c b/xen/arch/ia64/vmx/vmx_init.c similarity index 100% rename from xen/arch/ia64/vmx_init.c rename to xen/arch/ia64/vmx/vmx_init.c diff --git a/xen/arch/ia64/vmx_interrupt.c b/xen/arch/ia64/vmx/vmx_interrupt.c similarity index 100% rename from xen/arch/ia64/vmx_interrupt.c rename to xen/arch/ia64/vmx/vmx_interrupt.c diff --git a/xen/arch/ia64/vmx_irq_ia64.c b/xen/arch/ia64/vmx/vmx_irq_ia64.c similarity index 100% rename from xen/arch/ia64/vmx_irq_ia64.c rename to xen/arch/ia64/vmx/vmx_irq_ia64.c diff --git a/xen/arch/ia64/vmx_ivt.S b/xen/arch/ia64/vmx/vmx_ivt.S similarity index 100% rename from xen/arch/ia64/vmx_ivt.S rename to xen/arch/ia64/vmx/vmx_ivt.S diff --git a/xen/arch/ia64/vmx_minstate.h b/xen/arch/ia64/vmx/vmx_minstate.h similarity index 100% rename from xen/arch/ia64/vmx_minstate.h rename to xen/arch/ia64/vmx/vmx_minstate.h diff --git a/xen/arch/ia64/vmx_phy_mode.c b/xen/arch/ia64/vmx/vmx_phy_mode.c similarity index 100% rename from xen/arch/ia64/vmx_phy_mode.c rename to xen/arch/ia64/vmx/vmx_phy_mode.c diff --git a/xen/arch/ia64/vmx_process.c b/xen/arch/ia64/vmx/vmx_process.c similarity index 100% rename from xen/arch/ia64/vmx_process.c rename to xen/arch/ia64/vmx/vmx_process.c diff --git a/xen/arch/ia64/vmx_support.c b/xen/arch/ia64/vmx/vmx_support.c similarity index 100% rename from xen/arch/ia64/vmx_support.c rename to xen/arch/ia64/vmx/vmx_support.c diff --git a/xen/arch/ia64/vmx_utility.c b/xen/arch/ia64/vmx/vmx_utility.c similarity index 100% rename from xen/arch/ia64/vmx_utility.c rename to xen/arch/ia64/vmx/vmx_utility.c diff --git a/xen/arch/ia64/vmx_vcpu.c b/xen/arch/ia64/vmx/vmx_vcpu.c similarity index 100% rename from xen/arch/ia64/vmx_vcpu.c rename to xen/arch/ia64/vmx/vmx_vcpu.c diff --git a/xen/arch/ia64/vmx_virt.c b/xen/arch/ia64/vmx/vmx_virt.c similarity index 100% rename from xen/arch/ia64/vmx_virt.c rename to xen/arch/ia64/vmx/vmx_virt.c diff --git a/xen/arch/ia64/vmx_vsa.S b/xen/arch/ia64/vmx/vmx_vsa.S similarity index 100% rename from xen/arch/ia64/vmx_vsa.S rename to xen/arch/ia64/vmx/vmx_vsa.S diff --git a/xen/arch/ia64/vtlb.c b/xen/arch/ia64/vmx/vtlb.c similarity index 100% rename from xen/arch/ia64/vtlb.c rename to xen/arch/ia64/vmx/vtlb.c diff --git a/xen/arch/ia64/acpi.c b/xen/arch/ia64/xen/acpi.c similarity index 100% rename from xen/arch/ia64/acpi.c rename to xen/arch/ia64/xen/acpi.c diff --git a/xen/arch/ia64/dom0_ops.c b/xen/arch/ia64/xen/dom0_ops.c similarity index 100% rename from xen/arch/ia64/dom0_ops.c rename to xen/arch/ia64/xen/dom0_ops.c diff --git a/xen/arch/ia64/dom_fw.c b/xen/arch/ia64/xen/dom_fw.c similarity index 100% rename from xen/arch/ia64/dom_fw.c rename to xen/arch/ia64/xen/dom_fw.c diff --git a/xen/arch/ia64/domain.c b/xen/arch/ia64/xen/domain.c similarity index 100% rename from xen/arch/ia64/domain.c rename to xen/arch/ia64/xen/domain.c diff --git a/xen/arch/ia64/grant_table.c b/xen/arch/ia64/xen/grant_table.c similarity index 100% rename from xen/arch/ia64/grant_table.c rename to xen/arch/ia64/xen/grant_table.c diff --git a/xen/arch/ia64/hpsimserial.c b/xen/arch/ia64/xen/hpsimserial.c similarity index 100% rename from xen/arch/ia64/hpsimserial.c rename to xen/arch/ia64/xen/hpsimserial.c diff --git a/xen/arch/ia64/hypercall.c b/xen/arch/ia64/xen/hypercall.c similarity index 100% rename from xen/arch/ia64/hypercall.c rename to xen/arch/ia64/xen/hypercall.c diff --git a/xen/arch/ia64/hyperprivop.S b/xen/arch/ia64/xen/hyperprivop.S similarity index 100% rename from xen/arch/ia64/hyperprivop.S rename to xen/arch/ia64/xen/hyperprivop.S diff --git a/xen/arch/ia64/idle0_task.c b/xen/arch/ia64/xen/idle0_task.c similarity index 100% rename from xen/arch/ia64/idle0_task.c rename to xen/arch/ia64/xen/idle0_task.c diff --git a/xen/arch/ia64/irq.c b/xen/arch/ia64/xen/irq.c similarity index 100% rename from xen/arch/ia64/irq.c rename to xen/arch/ia64/xen/irq.c diff --git a/xen/arch/ia64/ivt.S b/xen/arch/ia64/xen/ivt.S similarity index 100% rename from xen/arch/ia64/ivt.S rename to xen/arch/ia64/xen/ivt.S diff --git a/xen/arch/ia64/mm_init.c b/xen/arch/ia64/xen/mm_init.c similarity index 99% rename from xen/arch/ia64/mm_init.c rename to xen/arch/ia64/xen/mm_init.c index 0e3ce45dec..8b4947f8f6 100644 --- a/xen/arch/ia64/mm_init.c +++ b/xen/arch/ia64/xen/mm_init.c @@ -196,6 +196,7 @@ out: ///////////////////////////////////////////// #endif /* XEN */ +#if 0 void update_mmu_cache (struct vm_area_struct *vma, unsigned long vaddr, pte_t pte) { @@ -215,6 +216,7 @@ update_mmu_cache (struct vm_area_struct *vma, unsigned long vaddr, pte_t pte) flush_icache_range(addr, addr + PAGE_SIZE); set_bit(PG_arch_1, &page->flags); /* mark page as clean */ } +#endif inline void ia64_set_rbs_bot (void) diff --git a/xen/arch/ia64/pcdp.c b/xen/arch/ia64/xen/pcdp.c similarity index 100% rename from xen/arch/ia64/pcdp.c rename to xen/arch/ia64/xen/pcdp.c diff --git a/xen/arch/ia64/privop.c b/xen/arch/ia64/xen/privop.c similarity index 100% rename from xen/arch/ia64/privop.c rename to xen/arch/ia64/xen/privop.c diff --git a/xen/arch/ia64/process.c b/xen/arch/ia64/xen/process.c similarity index 100% rename from xen/arch/ia64/process.c rename to xen/arch/ia64/xen/process.c diff --git a/xen/arch/ia64/regionreg.c b/xen/arch/ia64/xen/regionreg.c similarity index 100% rename from xen/arch/ia64/regionreg.c rename to xen/arch/ia64/xen/regionreg.c diff --git a/xen/arch/ia64/sn_console.c b/xen/arch/ia64/xen/sn_console.c similarity index 100% rename from xen/arch/ia64/sn_console.c rename to xen/arch/ia64/xen/sn_console.c diff --git a/xen/arch/ia64/vcpu.c b/xen/arch/ia64/xen/vcpu.c similarity index 100% rename from xen/arch/ia64/vcpu.c rename to xen/arch/ia64/xen/vcpu.c diff --git a/xen/arch/ia64/vhpt.c b/xen/arch/ia64/xen/vhpt.c similarity index 100% rename from xen/arch/ia64/vhpt.c rename to xen/arch/ia64/xen/vhpt.c diff --git a/xen/arch/ia64/xen.lds.S b/xen/arch/ia64/xen/xen.lds.S similarity index 100% rename from xen/arch/ia64/xen.lds.S rename to xen/arch/ia64/xen/xen.lds.S diff --git a/xen/arch/ia64/xenasm.S b/xen/arch/ia64/xen/xenasm.S similarity index 100% rename from xen/arch/ia64/xenasm.S rename to xen/arch/ia64/xen/xenasm.S diff --git a/xen/arch/ia64/xenirq.c b/xen/arch/ia64/xen/xenirq.c similarity index 98% rename from xen/arch/ia64/xenirq.c rename to xen/arch/ia64/xen/xenirq.c index 296cd3267b..bf4778e01e 100644 --- a/xen/arch/ia64/xenirq.c +++ b/xen/arch/ia64/xen/xenirq.c @@ -8,6 +8,7 @@ #include #include +#include void diff --git a/xen/arch/ia64/xenmem.c b/xen/arch/ia64/xen/xenmem.c similarity index 100% rename from xen/arch/ia64/xenmem.c rename to xen/arch/ia64/xen/xenmem.c diff --git a/xen/arch/ia64/xenmisc.c b/xen/arch/ia64/xen/xenmisc.c similarity index 99% rename from xen/arch/ia64/xenmisc.c rename to xen/arch/ia64/xen/xenmisc.c index 55f87e45d8..1a4d744407 100644 --- a/xen/arch/ia64/xenmisc.c +++ b/xen/arch/ia64/xen/xenmisc.c @@ -143,7 +143,7 @@ int reprogram_ac_timer(s_time_t timeout) DEFINE_PER_CPU(struct page_state, page_states) = {0}; unsigned long totalram_pages; -void __mod_page_state(unsigned offset, unsigned long delta) +void __mod_page_state(unsigned long offset, unsigned long delta) { unsigned long flags; void* ptr; diff --git a/xen/arch/ia64/xensetup.c b/xen/arch/ia64/xen/xensetup.c similarity index 100% rename from xen/arch/ia64/xensetup.c rename to xen/arch/ia64/xen/xensetup.c diff --git a/xen/arch/ia64/xentime.c b/xen/arch/ia64/xen/xentime.c similarity index 100% rename from xen/arch/ia64/xentime.c rename to xen/arch/ia64/xen/xentime.c diff --git a/xen/include/asm-ia64/config.h b/xen/include/asm-ia64/config.h index 90763d515f..5e13f290ba 100644 --- a/xen/include/asm-ia64/config.h +++ b/xen/include/asm-ia64/config.h @@ -203,6 +203,7 @@ void sort_main_extable(void); #endif // CONFIG_VTI #define __attribute_used__ __attribute__ ((unused)) +#define __nocast // see include/asm-x86/atomic.h (different from standard linux) #define _atomic_set(v,i) (((v).counter) = (i)) @@ -262,9 +263,6 @@ void dummy_called(char *function); // these declarations got moved at some point, find a better place for them extern int ht_per_core; -// needed for include/xen/smp.h -#define __smp_processor_id() 0 - // xen/include/asm/config.h /****************************************************************************** * config.h @@ -297,6 +295,10 @@ extern int ht_per_core; #endif /* __ASSEMBLY__ */ #endif /* __XEN_IA64_CONFIG_H__ */ +// needed for include/xen/smp.h +#define __smp_processor_id() 0 + + // FOLLOWING ADDED FOR XEN POST-NGIO and/or LINUX 2.6.7 // following derived from linux/include/linux/compiler-gcc3.h diff --git a/xen/include/asm-ia64/linux/asm/pgtable.h b/xen/include/asm-ia64/linux-xen/asm/pgtable.h similarity index 92% rename from xen/include/asm-ia64/linux/asm/pgtable.h rename to xen/include/asm-ia64/linux-xen/asm/pgtable.h index 594f73f8b5..0e8ffa2ddf 100644 --- a/xen/include/asm-ia64/linux/asm/pgtable.h +++ b/xen/include/asm-ia64/linux-xen/asm/pgtable.h @@ -8,7 +8,7 @@ * This hopefully works with any (fixed) IA-64 page-size, as defined * in . * - * Copyright (C) 1998-2004 Hewlett-Packard Co + * Copyright (C) 1998-2005 Hewlett-Packard Co * David Mosberger-Tang */ @@ -19,6 +19,11 @@ #include #include #include +#ifdef XEN +#ifndef __ASSEMBLY__ +#include /* needed for mm_struct (via asm/domain.h) */ +#endif +#endif #define IA64_MAX_PHYS_BITS 50 /* max. number of physical address bits (architected) */ @@ -93,7 +98,7 @@ #define PGDIR_MASK (~(PGDIR_SIZE-1)) #define PTRS_PER_PGD (1UL << (PAGE_SHIFT-3)) #define USER_PTRS_PER_PGD (5*PTRS_PER_PGD/8) /* regions 0-4 are user regions */ -#define FIRST_USER_PGD_NR 0 +#define FIRST_USER_ADDRESS 0 /* * Definitions for second level: @@ -202,6 +207,7 @@ ia64_phys_addr_valid (unsigned long addr) * the PTE in a page table. Nothing special needs to be on IA-64. */ #define set_pte(ptep, pteval) (*(ptep) = (pteval)) +#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) #define RGN_SIZE (1UL << 61) #define RGN_KERNEL 7 @@ -243,7 +249,7 @@ ia64_phys_addr_valid (unsigned long addr) #define pte_none(pte) (!pte_val(pte)) #define pte_present(pte) (pte_val(pte) & (_PAGE_P | _PAGE_PROTNONE)) -#define pte_clear(pte) (pte_val(*(pte)) = 0UL) +#define pte_clear(mm,addr,pte) (pte_val(*(pte)) = 0UL) /* pte_page() returns the "struct page *" corresponding to the PTE: */ #define pte_page(pte) virt_to_page(((pte_val(pte) & _PFN_MASK) + PAGE_OFFSET)) @@ -282,6 +288,7 @@ ia64_phys_addr_valid (unsigned long addr) #define pte_mkyoung(pte) (__pte(pte_val(pte) | _PAGE_A)) #define pte_mkclean(pte) (__pte(pte_val(pte) & ~_PAGE_D)) #define pte_mkdirty(pte) (__pte(pte_val(pte) | _PAGE_D)) +#define pte_mkhuge(pte) (__pte(pte_val(pte) | _PAGE_P)) /* * Macro to a page protection value as "uncacheable". Note that "protection" is really a @@ -345,7 +352,7 @@ pgd_offset (struct mm_struct *mm, unsigned long address) /* atomic versions of the some PTE manipulations: */ static inline int -ptep_test_and_clear_young (pte_t *ptep) +ptep_test_and_clear_young (struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) { #ifdef CONFIG_SMP if (!pte_young(*ptep)) @@ -355,13 +362,13 @@ ptep_test_and_clear_young (pte_t *ptep) pte_t pte = *ptep; if (!pte_young(pte)) return 0; - set_pte(ptep, pte_mkold(pte)); + set_pte_at(vma->vm_mm, addr, ptep, pte_mkold(pte)); return 1; #endif } static inline int -ptep_test_and_clear_dirty (pte_t *ptep) +ptep_test_and_clear_dirty (struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) { #ifdef CONFIG_SMP if (!pte_dirty(*ptep)) @@ -371,25 +378,25 @@ ptep_test_and_clear_dirty (pte_t *ptep) pte_t pte = *ptep; if (!pte_dirty(pte)) return 0; - set_pte(ptep, pte_mkclean(pte)); + set_pte_at(vma->vm_mm, addr, ptep, pte_mkclean(pte)); return 1; #endif } static inline pte_t -ptep_get_and_clear (pte_t *ptep) +ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) { #ifdef CONFIG_SMP return __pte(xchg((long *) ptep, 0)); #else pte_t pte = *ptep; - pte_clear(ptep); + pte_clear(mm, addr, ptep); return pte; #endif } static inline void -ptep_set_wrprotect (pte_t *ptep) +ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep) { #ifdef CONFIG_SMP unsigned long new, old; @@ -400,18 +407,7 @@ ptep_set_wrprotect (pte_t *ptep) } while (cmpxchg((unsigned long *) ptep, old, new) != old); #else pte_t old_pte = *ptep; - set_pte(ptep, pte_wrprotect(old_pte)); -#endif -} - -static inline void -ptep_mkdirty (pte_t *ptep) -{ -#ifdef CONFIG_SMP - set_bit(_PAGE_D_BIT, ptep); -#else - pte_t old_pte = *ptep; - set_pte(ptep, pte_mkdirty(old_pte)); + set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte)); #endif } @@ -421,6 +417,8 @@ pte_same (pte_t a, pte_t b) return pte_val(a) == pte_val(b); } +#define update_mmu_cache(vma, address, pte) do { } while (0) + extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; extern void paging_init (void); @@ -457,6 +455,13 @@ extern void paging_init (void); #define io_remap_page_range(vma, vaddr, paddr, size, prot) \ remap_pfn_range(vma, vaddr, (paddr) >> PAGE_SHIFT, size, prot) +#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ + remap_pfn_range(vma, vaddr, pfn, size, prot) + +#define MK_IOSPACE_PFN(space, pfn) (pfn) +#define GET_IOSPACE(pfn) 0 +#define GET_PFN(pfn) (pfn) + /* * ZERO_PAGE is a global shared page that is always zero: used * for zero-mapped memory areas etc.. @@ -473,8 +478,8 @@ extern struct page *zero_page_memmap_ptr; #define HUGETLB_PGDIR_SIZE (__IA64_UL(1) << HUGETLB_PGDIR_SHIFT) #define HUGETLB_PGDIR_MASK (~(HUGETLB_PGDIR_SIZE-1)) struct mmu_gather; -extern void hugetlb_free_pgtables(struct mmu_gather *tlb, - struct vm_area_struct * prev, unsigned long start, unsigned long end); +void hugetlb_free_pgd_range(struct mmu_gather **tlb, unsigned long addr, + unsigned long end, unsigned long floor, unsigned long ceiling); #endif /* @@ -482,7 +487,7 @@ extern void hugetlb_free_pgtables(struct mmu_gather *tlb, * information. However, we use this routine to take care of any (delayed) i-cache * flushing that may be necessary. */ -extern void update_mmu_cache (struct vm_area_struct *vma, unsigned long vaddr, pte_t pte); +extern void lazy_mmu_prot_update (pte_t pte); #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS /* @@ -552,16 +557,21 @@ do { \ /* These tell get_user_pages() that the first gate page is accessible from user-level. */ #define FIXADDR_USER_START GATE_ADDR -#define FIXADDR_USER_END (GATE_ADDR + 2*PERCPU_PAGE_SIZE) +#ifdef HAVE_BUGGY_SEGREL +# define FIXADDR_USER_END (GATE_ADDR + 2*PAGE_SIZE) +#else +# define FIXADDR_USER_END (GATE_ADDR + 2*PERCPU_PAGE_SIZE) +#endif #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY #define __HAVE_ARCH_PTEP_GET_AND_CLEAR #define __HAVE_ARCH_PTEP_SET_WRPROTECT -#define __HAVE_ARCH_PTEP_MKDIRTY #define __HAVE_ARCH_PTE_SAME #define __HAVE_ARCH_PGD_OFFSET_GATE -#include +#define __HAVE_ARCH_LAZY_MMU_PROT_UPDATE + #include +#include #endif /* _ASM_IA64_PGTABLE_H */ diff --git a/xen/include/asm-ia64/linux/asm-generic/bug.h b/xen/include/asm-ia64/linux/asm-generic/bug.h index e5913c3b71..400c2b4189 100644 --- a/xen/include/asm-ia64/linux/asm-generic/bug.h +++ b/xen/include/asm-ia64/linux/asm-generic/bug.h @@ -4,6 +4,7 @@ #include #include +#ifdef CONFIG_BUG #ifndef HAVE_ARCH_BUG #define BUG() do { \ printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ @@ -11,13 +12,6 @@ } while (0) #endif -#ifndef HAVE_ARCH_PAGE_BUG -#define PAGE_BUG(page) do { \ - printk("page BUG for page at %p\n", page); \ - BUG(); \ -} while (0) -#endif - #ifndef HAVE_ARCH_BUG_ON #define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0) #endif @@ -31,4 +25,18 @@ } while (0) #endif +#else /* !CONFIG_BUG */ +#ifndef HAVE_ARCH_BUG +#define BUG() +#endif + +#ifndef HAVE_ARCH_BUG_ON +#define BUG_ON(condition) do { if (condition) ; } while(0) +#endif + +#ifndef HAVE_ARCH_WARN_ON +#define WARN_ON(condition) do { if (condition) ; } while(0) +#endif +#endif + #endif diff --git a/xen/include/asm-ia64/linux/asm-generic/errno.h b/xen/include/asm-ia64/linux/asm-generic/errno.h index 4dd2384bc3..e8852c092f 100644 --- a/xen/include/asm-ia64/linux/asm-generic/errno.h +++ b/xen/include/asm-ia64/linux/asm-generic/errno.h @@ -102,4 +102,8 @@ #define EKEYREVOKED 128 /* Key has been revoked */ #define EKEYREJECTED 129 /* Key was rejected by service */ +/* for robust mutexes */ +#define EOWNERDEAD 130 /* Owner died */ +#define ENOTRECOVERABLE 131 /* State not recoverable */ + #endif diff --git a/xen/include/asm-ia64/linux/asm-generic/iomap.h b/xen/include/asm-ia64/linux/asm-generic/iomap.h index 4991543d44..cde592fca4 100644 --- a/xen/include/asm-ia64/linux/asm-generic/iomap.h +++ b/xen/include/asm-ia64/linux/asm-generic/iomap.h @@ -2,6 +2,7 @@ #define __GENERIC_IO_H #include +#include /* * These are the "generic" interfaces for doing new-style @@ -26,11 +27,15 @@ */ extern unsigned int fastcall ioread8(void __iomem *); extern unsigned int fastcall ioread16(void __iomem *); +extern unsigned int fastcall ioread16be(void __iomem *); extern unsigned int fastcall ioread32(void __iomem *); +extern unsigned int fastcall ioread32be(void __iomem *); extern void fastcall iowrite8(u8, void __iomem *); extern void fastcall iowrite16(u16, void __iomem *); +extern void fastcall iowrite16be(u16, void __iomem *); extern void fastcall iowrite32(u32, void __iomem *); +extern void fastcall iowrite32be(u32, void __iomem *); /* * "string" versions of the above. Note that they diff --git a/xen/include/asm-ia64/linux/asm-generic/pci.h b/xen/include/asm-ia64/linux/asm-generic/pci.h index 9d4cc47bde..ee1d8b5d81 100644 --- a/xen/include/asm-ia64/linux/asm-generic/pci.h +++ b/xen/include/asm-ia64/linux/asm-generic/pci.h @@ -22,6 +22,14 @@ pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, region->end = res->end; } +static inline void +pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, + struct pci_bus_region *region) +{ + res->start = region->start; + res->end = region->end; +} + #define pcibios_scan_all_fns(a, b) 0 #ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ diff --git a/xen/include/asm-ia64/linux/asm-generic/pgtable-nopud.h b/xen/include/asm-ia64/linux/asm-generic/pgtable-nopud.h index ffce31fef9..82e29f0ce4 100644 --- a/xen/include/asm-ia64/linux/asm-generic/pgtable-nopud.h +++ b/xen/include/asm-ia64/linux/asm-generic/pgtable-nopud.h @@ -3,6 +3,8 @@ #ifndef __ASSEMBLY__ +#define __PAGETABLE_PUD_FOLDED + /* * Having the pud type consist of a pgd gets the size right, and allows * us to conceptually access the pgd entry that this pud is folded into @@ -52,5 +54,8 @@ static inline pud_t * pud_offset(pgd_t * pgd, unsigned long address) #define pud_free(x) do { } while (0) #define __pud_free_tlb(tlb, x) do { } while (0) +#undef pud_addr_end +#define pud_addr_end(addr, end) (end) + #endif /* __ASSEMBLY__ */ #endif /* _PGTABLE_NOPUD_H */ diff --git a/xen/include/asm-ia64/linux/asm-generic/pgtable.h b/xen/include/asm-ia64/linux/asm-generic/pgtable.h index cf791b073e..f405935651 100644 --- a/xen/include/asm-ia64/linux/asm-generic/pgtable.h +++ b/xen/include/asm-ia64/linux/asm-generic/pgtable.h @@ -16,7 +16,7 @@ #ifndef __HAVE_ARCH_SET_PTE_ATOMIC #define ptep_establish(__vma, __address, __ptep, __entry) \ do { \ - set_pte(__ptep, __entry); \ + set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \ flush_tlb_page(__vma, __address); \ } while (0) #else /* __HAVE_ARCH_SET_PTE_ATOMIC */ @@ -37,26 +37,30 @@ do { \ */ #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ do { \ - set_pte(__ptep, __entry); \ + set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \ flush_tlb_page(__vma, __address); \ } while (0) #endif #ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG -static inline int ptep_test_and_clear_young(pte_t *ptep) -{ - pte_t pte = *ptep; - if (!pte_young(pte)) - return 0; - set_pte(ptep, pte_mkold(pte)); - return 1; -} +#define ptep_test_and_clear_young(__vma, __address, __ptep) \ +({ \ + pte_t __pte = *(__ptep); \ + int r = 1; \ + if (!pte_young(__pte)) \ + r = 0; \ + else \ + set_pte_at((__vma)->vm_mm, (__address), \ + (__ptep), pte_mkold(__pte)); \ + r; \ +}) #endif #ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH #define ptep_clear_flush_young(__vma, __address, __ptep) \ ({ \ - int __young = ptep_test_and_clear_young(__ptep); \ + int __young; \ + __young = ptep_test_and_clear_young(__vma, __address, __ptep); \ if (__young) \ flush_tlb_page(__vma, __address); \ __young; \ @@ -64,20 +68,24 @@ static inline int ptep_test_and_clear_young(pte_t *ptep) #endif #ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY -static inline int ptep_test_and_clear_dirty(pte_t *ptep) -{ - pte_t pte = *ptep; - if (!pte_dirty(pte)) - return 0; - set_pte(ptep, pte_mkclean(pte)); - return 1; -} +#define ptep_test_and_clear_dirty(__vma, __address, __ptep) \ +({ \ + pte_t __pte = *__ptep; \ + int r = 1; \ + if (!pte_dirty(__pte)) \ + r = 0; \ + else \ + set_pte_at((__vma)->vm_mm, (__address), (__ptep), \ + pte_mkclean(__pte)); \ + r; \ +}) #endif #ifndef __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH #define ptep_clear_flush_dirty(__vma, __address, __ptep) \ ({ \ - int __dirty = ptep_test_and_clear_dirty(__ptep); \ + int __dirty; \ + __dirty = ptep_test_and_clear_dirty(__vma, __address, __ptep); \ if (__dirty) \ flush_tlb_page(__vma, __address); \ __dirty; \ @@ -85,36 +93,29 @@ static inline int ptep_test_and_clear_dirty(pte_t *ptep) #endif #ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR -static inline pte_t ptep_get_and_clear(pte_t *ptep) -{ - pte_t pte = *ptep; - pte_clear(ptep); - return pte; -} +#define ptep_get_and_clear(__mm, __address, __ptep) \ +({ \ + pte_t __pte = *(__ptep); \ + pte_clear((__mm), (__address), (__ptep)); \ + __pte; \ +}) #endif #ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH #define ptep_clear_flush(__vma, __address, __ptep) \ ({ \ - pte_t __pte = ptep_get_and_clear(__ptep); \ + pte_t __pte; \ + __pte = ptep_get_and_clear((__vma)->vm_mm, __address, __ptep); \ flush_tlb_page(__vma, __address); \ __pte; \ }) #endif #ifndef __HAVE_ARCH_PTEP_SET_WRPROTECT -static inline void ptep_set_wrprotect(pte_t *ptep) +static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long address, pte_t *ptep) { pte_t old_pte = *ptep; - set_pte(ptep, pte_wrprotect(old_pte)); -} -#endif - -#ifndef __HAVE_ARCH_PTEP_MKDIRTY -static inline void ptep_mkdirty(pte_t *ptep) -{ - pte_t old_pte = *ptep; - set_pte(ptep, pte_mkdirty(old_pte)); + set_pte_at(mm, address, ptep, pte_wrprotect(old_pte)); } #endif @@ -124,6 +125,9 @@ static inline void ptep_mkdirty(pte_t *ptep) #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY #define page_test_and_clear_dirty(page) (0) +#define pte_maybe_dirty(pte) pte_dirty(pte) +#else +#define pte_maybe_dirty(pte) (1) #endif #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG @@ -134,4 +138,77 @@ static inline void ptep_mkdirty(pte_t *ptep) #define pgd_offset_gate(mm, addr) pgd_offset(mm, addr) #endif +#ifndef __HAVE_ARCH_LAZY_MMU_PROT_UPDATE +#define lazy_mmu_prot_update(pte) do { } while (0) +#endif + +/* + * When walking page tables, get the address of the next boundary, + * or the end address of the range if that comes earlier. Although no + * vma end wraps to 0, rounded up __boundary may wrap to 0 throughout. + */ + +#define pgd_addr_end(addr, end) \ +({ unsigned long __boundary = ((addr) + PGDIR_SIZE) & PGDIR_MASK; \ + (__boundary - 1 < (end) - 1)? __boundary: (end); \ +}) + +#ifndef pud_addr_end +#define pud_addr_end(addr, end) \ +({ unsigned long __boundary = ((addr) + PUD_SIZE) & PUD_MASK; \ + (__boundary - 1 < (end) - 1)? __boundary: (end); \ +}) +#endif + +#ifndef pmd_addr_end +#define pmd_addr_end(addr, end) \ +({ unsigned long __boundary = ((addr) + PMD_SIZE) & PMD_MASK; \ + (__boundary - 1 < (end) - 1)? __boundary: (end); \ +}) +#endif + +#ifndef __ASSEMBLY__ +/* + * When walking page tables, we usually want to skip any p?d_none entries; + * and any p?d_bad entries - reporting the error before resetting to none. + * Do the tests inline, but report and clear the bad entry in mm/memory.c. + */ +void pgd_clear_bad(pgd_t *); +void pud_clear_bad(pud_t *); +void pmd_clear_bad(pmd_t *); + +static inline int pgd_none_or_clear_bad(pgd_t *pgd) +{ + if (pgd_none(*pgd)) + return 1; + if (unlikely(pgd_bad(*pgd))) { + pgd_clear_bad(pgd); + return 1; + } + return 0; +} + +static inline int pud_none_or_clear_bad(pud_t *pud) +{ + if (pud_none(*pud)) + return 1; + if (unlikely(pud_bad(*pud))) { + pud_clear_bad(pud); + return 1; + } + return 0; +} + +static inline int pmd_none_or_clear_bad(pmd_t *pmd) +{ + if (pmd_none(*pmd)) + return 1; + if (unlikely(pmd_bad(*pmd))) { + pmd_clear_bad(pmd); + return 1; + } + return 0; +} +#endif /* !__ASSEMBLY__ */ + #endif /* _ASM_GENERIC_PGTABLE_H */ diff --git a/xen/include/asm-ia64/linux/asm-generic/sections.h b/xen/include/asm-ia64/linux/asm-generic/sections.h index 976ac29598..450eae22c3 100644 --- a/xen/include/asm-ia64/linux/asm-generic/sections.h +++ b/xen/include/asm-ia64/linux/asm-generic/sections.h @@ -8,6 +8,9 @@ extern char _data[], _sdata[], _edata[]; extern char __bss_start[], __bss_stop[]; extern char __init_begin[], __init_end[]; extern char _sinittext[], _einittext[]; +extern char _sextratext[] __attribute__((weak)); +extern char _eextratext[] __attribute__((weak)); extern char _end[]; +extern char __per_cpu_start[], __per_cpu_end[]; #endif /* _ASM_GENERIC_SECTIONS_H_ */ diff --git a/xen/include/asm-ia64/linux/asm-generic/topology.h b/xen/include/asm-ia64/linux/asm-generic/topology.h index ec96e8b0f1..5d9d70cd17 100644 --- a/xen/include/asm-ia64/linux/asm-generic/topology.h +++ b/xen/include/asm-ia64/linux/asm-generic/topology.h @@ -41,8 +41,15 @@ #ifndef node_to_first_cpu #define node_to_first_cpu(node) (0) #endif +#ifndef pcibus_to_node +#define pcibus_to_node(node) (-1) +#endif + #ifndef pcibus_to_cpumask -#define pcibus_to_cpumask(bus) (cpu_online_map) +#define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \ + CPU_MASK_ALL : \ + node_to_cpumask(pcibus_to_node(bus)) \ + ) #endif #endif /* _ASM_GENERIC_TOPOLOGY_H */ diff --git a/xen/include/asm-ia64/linux/asm-generic/unaligned.h b/xen/include/asm-ia64/linux/asm-generic/unaligned.h new file mode 100644 index 0000000000..6c90f0f36e --- /dev/null +++ b/xen/include/asm-ia64/linux/asm-generic/unaligned.h @@ -0,0 +1,122 @@ +#ifndef _ASM_GENERIC_UNALIGNED_H_ +#define _ASM_GENERIC_UNALIGNED_H_ + +/* + * For the benefit of those who are trying to port Linux to another + * architecture, here are some C-language equivalents. + * + * This is based almost entirely upon Richard Henderson's + * asm-alpha/unaligned.h implementation. Some comments were + * taken from David Mosberger's asm-ia64/unaligned.h header. + */ + +#include + +/* + * The main single-value unaligned transfer routines. + */ +#define get_unaligned(ptr) \ + ((__typeof__(*(ptr)))__get_unaligned((ptr), sizeof(*(ptr)))) +#define put_unaligned(x,ptr) \ + __put_unaligned((unsigned long)(x), (ptr), sizeof(*(ptr))) + +/* + * This function doesn't actually exist. The idea is that when + * someone uses the macros below with an unsupported size (datatype), + * the linker will alert us to the problem via an unresolved reference + * error. + */ +extern void bad_unaligned_access_length(void) __attribute__((noreturn)); + +struct __una_u64 { __u64 x __attribute__((packed)); }; +struct __una_u32 { __u32 x __attribute__((packed)); }; +struct __una_u16 { __u16 x __attribute__((packed)); }; + +/* + * Elemental unaligned loads + */ + +static inline unsigned long __uldq(const __u64 *addr) +{ + const struct __una_u64 *ptr = (const struct __una_u64 *) addr; + return ptr->x; +} + +static inline unsigned long __uldl(const __u32 *addr) +{ + const struct __una_u32 *ptr = (const struct __una_u32 *) addr; + return ptr->x; +} + +static inline unsigned long __uldw(const __u16 *addr) +{ + const struct __una_u16 *ptr = (const struct __una_u16 *) addr; + return ptr->x; +} + +/* + * Elemental unaligned stores + */ + +static inline void __ustq(__u64 val, __u64 *addr) +{ + struct __una_u64 *ptr = (struct __una_u64 *) addr; + ptr->x = val; +} + +static inline void __ustl(__u32 val, __u32 *addr) +{ + struct __una_u32 *ptr = (struct __una_u32 *) addr; + ptr->x = val; +} + +static inline void __ustw(__u16 val, __u16 *addr) +{ + struct __una_u16 *ptr = (struct __una_u16 *) addr; + ptr->x = val; +} + +#define __get_unaligned(ptr, size) ({ \ + const void *__gu_p = ptr; \ + unsigned long val; \ + switch (size) { \ + case 1: \ + val = *(const __u8 *)__gu_p; \ + break; \ + case 2: \ + val = __uldw(__gu_p); \ + break; \ + case 4: \ + val = __uldl(__gu_p); \ + break; \ + case 8: \ + val = __uldq(__gu_p); \ + break; \ + default: \ + bad_unaligned_access_length(); \ + }; \ + val; \ +}) + +#define __put_unaligned(val, ptr, size) \ +do { \ + void *__gu_p = ptr; \ + switch (size) { \ + case 1: \ + *(__u8 *)__gu_p = val; \ + break; \ + case 2: \ + __ustw(val, __gu_p); \ + break; \ + case 4: \ + __ustl(val, __gu_p); \ + break; \ + case 8: \ + __ustq(val, __gu_p); \ + break; \ + default: \ + bad_unaligned_access_length(); \ + }; \ +} while(0) + +#endif /* _ASM_GENERIC_UNALIGNED_H */ diff --git a/xen/include/asm-ia64/linux/asm-generic/vmlinux.lds.h b/xen/include/asm-ia64/linux/asm-generic/vmlinux.lds.h index 99cef06a36..b3bb326ae5 100644 --- a/xen/include/asm-ia64/linux/asm-generic/vmlinux.lds.h +++ b/xen/include/asm-ia64/linux/asm-generic/vmlinux.lds.h @@ -73,7 +73,7 @@ } #define SECURITY_INIT \ - .security_initcall.init : { \ + .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \ VMLINUX_SYMBOL(__security_initcall_start) = .; \ *(.security_initcall.init) \ VMLINUX_SYMBOL(__security_initcall_end) = .; \ diff --git a/xen/include/asm-ia64/linux/asm/acpi.h b/xen/include/asm-ia64/linux/asm/acpi.h index 6a26a977f2..4c06d45513 100644 --- a/xen/include/asm-ia64/linux/asm/acpi.h +++ b/xen/include/asm-ia64/linux/asm/acpi.h @@ -98,6 +98,15 @@ const char *acpi_get_sysname (void); int acpi_request_vector (u32 int_type); int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); +/* + * Record the cpei override flag and current logical cpu. This is + * useful for CPU removal. + */ +extern unsigned int can_cpei_retarget(void); +extern unsigned int is_cpu_cpei_target(unsigned int cpu); +extern void set_cpei_target_cpu(unsigned int cpu); +extern unsigned int get_cpei_target_cpu(void); + #ifdef CONFIG_ACPI_NUMA /* Proximity bitmap length; _PXM is at most 255 (8 bit)*/ #define MAX_PXM_DOMAINS (256) diff --git a/xen/include/asm-ia64/linux/asm/bitops.h b/xen/include/asm-ia64/linux/asm/bitops.h index 8052500a7c..7232528e2d 100644 --- a/xen/include/asm-ia64/linux/asm/bitops.h +++ b/xen/include/asm-ia64/linux/asm/bitops.h @@ -314,8 +314,8 @@ __ffs (unsigned long x) #ifdef __KERNEL__ /* - * find_last_zero_bit - find the last zero bit in a 64 bit quantity - * @x: The value to search + * Return bit number of last (most-significant) bit set. Undefined + * for x==0. Bits are numbered from 0..63 (e.g., ia64_fls(9) == 3). */ static inline unsigned long ia64_fls (unsigned long x) @@ -327,10 +327,23 @@ ia64_fls (unsigned long x) return exp - 0xffff; } +/* + * Find the last (most significant) bit set. Returns 0 for x==0 and + * bits are numbered from 1..32 (e.g., fls(9) == 4). + */ static inline int -fls (int x) +fls (int t) { - return ia64_fls((unsigned int) x); + unsigned long x = t & 0xffffffffu; + + if (!x) + return 0; + x |= x >> 1; + x |= x >> 2; + x |= x >> 4; + x |= x >> 8; + x |= x >> 16; + return ia64_popcnt(x); } /* @@ -353,9 +366,9 @@ hweight64 (unsigned long x) return result; } -#define hweight32(x) hweight64 ((x) & 0xfffffffful) -#define hweight16(x) hweight64 ((x) & 0xfffful) -#define hweight8(x) hweight64 ((x) & 0xfful) +#define hweight32(x) (unsigned int) hweight64((x) & 0xfffffffful) +#define hweight16(x) (unsigned int) hweight64((x) & 0xfffful) +#define hweight8(x) (unsigned int) hweight64((x) & 0xfful) #endif /* __KERNEL__ */ diff --git a/xen/include/asm-ia64/linux/asm/break.h b/xen/include/asm-ia64/linux/asm/break.h index 97c7b2d796..8167828edc 100644 --- a/xen/include/asm-ia64/linux/asm/break.h +++ b/xen/include/asm-ia64/linux/asm/break.h @@ -12,6 +12,8 @@ * OS-specific debug break numbers: */ #define __IA64_BREAK_KDB 0x80100 +#define __IA64_BREAK_KPROBE 0x80200 +#define __IA64_BREAK_JPROBE 0x80300 /* * OS-specific break numbers: diff --git a/xen/include/asm-ia64/linux/asm/bug.h b/xen/include/asm-ia64/linux/asm/bug.h index 2c0cd51e88..3aa0a0a547 100644 --- a/xen/include/asm-ia64/linux/asm/bug.h +++ b/xen/include/asm-ia64/linux/asm/bug.h @@ -1,6 +1,7 @@ #ifndef _ASM_IA64_BUG_H #define _ASM_IA64_BUG_H +#ifdef CONFIG_BUG #if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) # define ia64_abort() __builtin_trap() #else @@ -8,8 +9,10 @@ #endif #define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); ia64_abort(); } while (0) -/* should this BUG should be made generic? */ +/* should this BUG be made generic? */ #define HAVE_ARCH_BUG +#endif + #include #endif diff --git a/xen/include/asm-ia64/linux/asm/cacheflush.h b/xen/include/asm-ia64/linux/asm/cacheflush.h index ef0e256f23..f2dacb4245 100644 --- a/xen/include/asm-ia64/linux/asm/cacheflush.h +++ b/xen/include/asm-ia64/linux/asm/cacheflush.h @@ -19,7 +19,7 @@ #define flush_cache_all() do { } while (0) #define flush_cache_mm(mm) do { } while (0) #define flush_cache_range(vma, start, end) do { } while (0) -#define flush_cache_page(vma, vmaddr) do { } while (0) +#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) #define flush_icache_page(vma,page) do { } while (0) #define flush_cache_vmap(start, end) do { } while (0) #define flush_cache_vunmap(start, end) do { } while (0) diff --git a/xen/include/asm-ia64/linux/asm/numnodes.h b/xen/include/asm-ia64/linux/asm/numnodes.h new file mode 100644 index 0000000000..21cff4da54 --- /dev/null +++ b/xen/include/asm-ia64/linux/asm/numnodes.h @@ -0,0 +1,15 @@ +#ifndef _ASM_MAX_NUMNODES_H +#define _ASM_MAX_NUMNODES_H + +#ifdef CONFIG_IA64_DIG +/* Max 8 Nodes */ +#define NODES_SHIFT 3 +#elif defined(CONFIG_IA64_HP_ZX1) || defined(CONFIG_IA64_HP_ZX1_SWIOTLB) +/* Max 32 Nodes */ +#define NODES_SHIFT 5 +#elif defined(CONFIG_IA64_SGI_SN2) || defined(CONFIG_IA64_GENERIC) +/* Max 256 Nodes */ +#define NODES_SHIFT 8 +#endif + +#endif /* _ASM_MAX_NUMNODES_H */ diff --git a/xen/include/asm-ia64/linux/asm/param.h b/xen/include/asm-ia64/linux/asm/param.h index 6c6b679b7a..5e1e0d2d7b 100644 --- a/xen/include/asm-ia64/linux/asm/param.h +++ b/xen/include/asm-ia64/linux/asm/param.h @@ -27,7 +27,7 @@ */ # define HZ 32 # else -# define HZ 1024 +# define HZ CONFIG_HZ # endif # define USER_HZ HZ # define CLOCKS_PER_SEC HZ /* frequency at which times() counts */ diff --git a/xen/include/asm-ia64/linux/asm/pci.h b/xen/include/asm-ia64/linux/asm/pci.h index 48e565fb5e..dba9f220be 100644 --- a/xen/include/asm-ia64/linux/asm/pci.h +++ b/xen/include/asm-ia64/linux/asm/pci.h @@ -47,7 +47,7 @@ pcibios_set_master (struct pci_dev *dev) } static inline void -pcibios_penalize_isa_irq (int irq) +pcibios_penalize_isa_irq (int irq, int active) { /* We don't do dynamic PCI IRQ allocation */ } @@ -82,6 +82,25 @@ extern int pcibios_prep_mwi (struct pci_dev *); #define sg_dma_len(sg) ((sg)->dma_length) #define sg_dma_address(sg) ((sg)->dma_address) +#ifdef CONFIG_PCI +static inline void pci_dma_burst_advice(struct pci_dev *pdev, + enum pci_dma_burst_strategy *strat, + unsigned long *strategy_parameter) +{ + unsigned long cacheline_size; + u8 byte; + + pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &byte); + if (byte == 0) + cacheline_size = 1024; + else + cacheline_size = (int) byte * 4; + + *strat = PCI_DMA_BURST_MULTIPLE; + *strategy_parameter = cacheline_size; +} +#endif + #define HAVE_PCI_MMAP extern int pci_mmap_page_range (struct pci_dev *dev, struct vm_area_struct *vma, enum pci_mmap_state mmap_state, int write_combine); @@ -109,6 +128,7 @@ struct pci_controller { void *acpi_handle; void *iommu; int segment; + int node; /* nearest node with memory or -1 for global allocation */ unsigned int windows; struct pci_window *window; @@ -121,14 +141,9 @@ struct pci_controller { extern struct pci_ops pci_root_ops; -static inline int pci_name_bus(char *name, struct pci_bus *bus) +static inline int pci_proc_domain(struct pci_bus *bus) { - if (pci_domain_nr(bus) == 0) { - sprintf(name, "%02x", bus->number); - } else { - sprintf(name, "%04x:%02x", pci_domain_nr(bus), bus->number); - } - return 0; + return (pci_domain_nr(bus) != 0); } static inline void pcibios_add_platform_entries(struct pci_dev *dev) diff --git a/xen/include/asm-ia64/linux/asm/percpu.h b/xen/include/asm-ia64/linux/asm/percpu.h index 1e87f19dad..2b14dee29c 100644 --- a/xen/include/asm-ia64/linux/asm/percpu.h +++ b/xen/include/asm-ia64/linux/asm/percpu.h @@ -50,7 +50,7 @@ extern void *per_cpu_init(void); #else /* ! SMP */ -#define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var)) +#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) #define __get_cpu_var(var) per_cpu__##var #define per_cpu_init() (__phys_per_cpu_start) diff --git a/xen/include/asm-ia64/linux/asm/sections.h b/xen/include/asm-ia64/linux/asm/sections.h index 8e3dbde1b4..e9eb7f62d3 100644 --- a/xen/include/asm-ia64/linux/asm/sections.h +++ b/xen/include/asm-ia64/linux/asm/sections.h @@ -17,6 +17,7 @@ extern char __start_gate_vtop_patchlist[], __end_gate_vtop_patchlist[]; extern char __start_gate_fsyscall_patchlist[], __end_gate_fsyscall_patchlist[]; extern char __start_gate_brl_fsys_bubble_down_patchlist[], __end_gate_brl_fsys_bubble_down_patchlist[]; extern char __start_unwind[], __end_unwind[]; +extern char __start_ivt_text[], __end_ivt_text[]; #endif /* _ASM_IA64_SECTIONS_H */ diff --git a/xen/include/asm-ia64/linux/asm/signal.h b/xen/include/asm-ia64/linux/asm/signal.h index 660a759744..608168d713 100644 --- a/xen/include/asm-ia64/linux/asm/signal.h +++ b/xen/include/asm-ia64/linux/asm/signal.h @@ -114,27 +114,11 @@ #define _NSIG_BPW 64 #define _NSIG_WORDS (_NSIG / _NSIG_BPW) -/* - * These values of sa_flags are used only by the kernel as part of the - * irq handling routines. - * - * SA_INTERRUPT is also used by the irq handling routines. - * SA_SHIRQ is for shared interrupt support on PCI and EISA. - */ -#define SA_PROBE SA_ONESHOT -#define SA_SAMPLE_RANDOM SA_RESTART -#define SA_SHIRQ 0x04000000 #define SA_PERCPU_IRQ 0x02000000 #endif /* __KERNEL__ */ -#define SIG_BLOCK 0 /* for blocking signals */ -#define SIG_UNBLOCK 1 /* for unblocking signals */ -#define SIG_SETMASK 2 /* for setting the signal mask */ - -#define SIG_DFL ((__sighandler_t)0) /* default signal handling */ -#define SIG_IGN ((__sighandler_t)1) /* ignore signal */ -#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */ +#include # ifndef __ASSEMBLY__ @@ -143,9 +127,6 @@ /* Avoid too many header ordering problems. */ struct siginfo; -/* Type of a signal handler. */ -typedef void __user (*__sighandler_t)(int); - typedef struct sigaltstack { void __user *ss_sp; int ss_flags; diff --git a/xen/include/asm-ia64/linux/asm/smp.h b/xen/include/asm-ia64/linux/asm/smp.h index d6838c9b7b..a3914352c9 100644 --- a/xen/include/asm-ia64/linux/asm/smp.h +++ b/xen/include/asm-ia64/linux/asm/smp.h @@ -3,16 +3,14 @@ * * Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 Walt Drummond - * Copyright (C) 2001-2003 Hewlett-Packard Co + * (c) Copyright 2001-2003, 2005 Hewlett-Packard Development Company, L.P. * David Mosberger-Tang + * Bjorn Helgaas */ #ifndef _ASM_IA64_SMP_H #define _ASM_IA64_SMP_H #include - -#ifdef CONFIG_SMP - #include #include #include @@ -24,12 +22,31 @@ #include #include +static inline unsigned int +ia64_get_lid (void) +{ + union { + struct { + unsigned long reserved : 16; + unsigned long eid : 8; + unsigned long id : 8; + unsigned long ignored : 32; + } f; + unsigned long bits; + } lid; + + lid.bits = ia64_getreg(_IA64_REG_CR_LID); + return lid.f.id << 8 | lid.f.eid; +} + +#ifdef CONFIG_SMP + #define XTP_OFFSET 0x1e0008 #define SMP_IRQ_REDIRECTION (1 << 0) #define SMP_IPI_REDIRECTION (1 << 1) -#define smp_processor_id() (current_thread_info()->cpu) +#define raw_smp_processor_id() (current_thread_info()->cpu) extern struct smp_boot_data { int cpu_count; @@ -39,6 +56,10 @@ extern struct smp_boot_data { extern char no_int_routing __devinitdata; extern cpumask_t cpu_online_map; +extern cpumask_t cpu_core_map[NR_CPUS]; +extern cpumask_t cpu_sibling_map[NR_CPUS]; +extern int smp_num_siblings; +extern int smp_num_cpucores; extern void __iomem *ipi_base_addr; extern unsigned char smp_int_redirect; @@ -90,22 +111,7 @@ max_xtp (void) writeb(0x0f, ipi_base_addr + XTP_OFFSET); /* Set XTP to max */ } -static inline unsigned int -hard_smp_processor_id (void) -{ - union { - struct { - unsigned long reserved : 16; - unsigned long eid : 8; - unsigned long id : 8; - unsigned long ignored : 32; - } f; - unsigned long bits; - } lid; - - lid.bits = ia64_getreg(_IA64_REG_CR_LID); - return lid.f.id << 8 | lid.f.eid; -} +#define hard_smp_processor_id() ia64_get_lid() /* Upping and downing of CPUs */ extern int __cpu_disable (void); @@ -122,10 +128,12 @@ extern int smp_call_function_single (int cpuid, void (*func) (void *info), void extern void smp_send_reschedule (int cpu); extern void lock_ipi_calllock(void); extern void unlock_ipi_calllock(void); +extern void identify_siblings (struct cpuinfo_ia64 *); #else -#define cpu_logical_id(cpuid) 0 +#define cpu_logical_id(i) 0 +#define cpu_physical_id(i) ia64_get_lid() #endif /* CONFIG_SMP */ #endif /* _ASM_IA64_SMP_H */ diff --git a/xen/include/asm-ia64/linux/asm/thread_info.h b/xen/include/asm-ia64/linux/asm/thread_info.h index 8d5b7e7702..7dc8951708 100644 --- a/xen/include/asm-ia64/linux/asm/thread_info.h +++ b/xen/include/asm-ia64/linux/asm/thread_info.h @@ -25,7 +25,7 @@ struct thread_info { __u32 flags; /* thread_info flags (see TIF_*) */ __u32 cpu; /* current CPU */ mm_segment_t addr_limit; /* user-level address space limit */ - __s32 preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */ + int preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */ struct restart_block restart_block; struct { int signo; diff --git a/xen/include/asm-ia64/linux/asm/topology.h b/xen/include/asm-ia64/linux/asm/topology.h index 21cf351fd0..399bc29729 100644 --- a/xen/include/asm-ia64/linux/asm/topology.h +++ b/xen/include/asm-ia64/linux/asm/topology.h @@ -40,27 +40,61 @@ */ #define node_to_first_cpu(node) (__ffs(node_to_cpumask(node))) +/* + * Determines the node for a given pci bus + */ +#define pcibus_to_node(bus) PCI_CONTROLLER(bus)->node + void build_cpu_to_node_map(void); +#define SD_CPU_INIT (struct sched_domain) { \ + .span = CPU_MASK_NONE, \ + .parent = NULL, \ + .groups = NULL, \ + .min_interval = 1, \ + .max_interval = 4, \ + .busy_factor = 64, \ + .imbalance_pct = 125, \ + .cache_hot_time = (10*1000000), \ + .per_cpu_gain = 100, \ + .cache_nice_tries = 2, \ + .busy_idx = 2, \ + .idle_idx = 1, \ + .newidle_idx = 2, \ + .wake_idx = 1, \ + .forkexec_idx = 1, \ + .flags = SD_LOAD_BALANCE \ + | SD_BALANCE_NEWIDLE \ + | SD_BALANCE_EXEC \ + | SD_WAKE_AFFINE, \ + .last_balance = jiffies, \ + .balance_interval = 1, \ + .nr_balance_failed = 0, \ +} + /* sched_domains SD_NODE_INIT for IA64 NUMA machines */ #define SD_NODE_INIT (struct sched_domain) { \ .span = CPU_MASK_NONE, \ .parent = NULL, \ .groups = NULL, \ - .min_interval = 80, \ - .max_interval = 320, \ - .busy_factor = 320, \ + .min_interval = 8, \ + .max_interval = 8*(min(num_online_cpus(), 32)), \ + .busy_factor = 64, \ .imbalance_pct = 125, \ .cache_hot_time = (10*1000000), \ - .cache_nice_tries = 1, \ + .cache_nice_tries = 2, \ + .busy_idx = 3, \ + .idle_idx = 2, \ + .newidle_idx = 0, /* unused */ \ + .wake_idx = 1, \ + .forkexec_idx = 1, \ .per_cpu_gain = 100, \ .flags = SD_LOAD_BALANCE \ | SD_BALANCE_EXEC \ - | SD_BALANCE_NEWIDLE \ - | SD_WAKE_IDLE \ + | SD_BALANCE_FORK \ | SD_WAKE_BALANCE, \ .last_balance = jiffies, \ - .balance_interval = 1, \ + .balance_interval = 64, \ .nr_balance_failed = 0, \ } @@ -69,17 +103,21 @@ void build_cpu_to_node_map(void); .span = CPU_MASK_NONE, \ .parent = NULL, \ .groups = NULL, \ - .min_interval = 80, \ - .max_interval = 320, \ - .busy_factor = 320, \ - .imbalance_pct = 125, \ + .min_interval = 64, \ + .max_interval = 64*num_online_cpus(), \ + .busy_factor = 128, \ + .imbalance_pct = 133, \ .cache_hot_time = (10*1000000), \ .cache_nice_tries = 1, \ + .busy_idx = 3, \ + .idle_idx = 3, \ + .newidle_idx = 0, /* unused */ \ + .wake_idx = 0, /* unused */ \ + .forkexec_idx = 0, /* unused */ \ .per_cpu_gain = 100, \ - .flags = SD_LOAD_BALANCE \ - | SD_BALANCE_EXEC, \ + .flags = SD_LOAD_BALANCE, \ .last_balance = jiffies, \ - .balance_interval = 100*(63+num_online_cpus())/64, \ + .balance_interval = 64, \ .nr_balance_failed = 0, \ } diff --git a/xen/include/asm-ia64/linux/asm/unaligned.h b/xen/include/asm-ia64/linux/asm/unaligned.h index b5d28366fd..bb85598881 100644 --- a/xen/include/asm-ia64/linux/asm/unaligned.h +++ b/xen/include/asm-ia64/linux/asm/unaligned.h @@ -1,121 +1,6 @@ #ifndef _ASM_IA64_UNALIGNED_H #define _ASM_IA64_UNALIGNED_H -#include - -/* - * The main single-value unaligned transfer routines. - * - * Based on . - * - * Copyright (C) 1998, 1999, 2003 Hewlett-Packard Co - * David Mosberger-Tang - */ -#define get_unaligned(ptr) \ - ((__typeof__(*(ptr)))ia64_get_unaligned((ptr), sizeof(*(ptr)))) - -#define put_unaligned(x,ptr) \ - ia64_put_unaligned((unsigned long)(x), (ptr), sizeof(*(ptr))) - -struct __una_u64 { __u64 x __attribute__((packed)); }; -struct __una_u32 { __u32 x __attribute__((packed)); }; -struct __una_u16 { __u16 x __attribute__((packed)); }; - -static inline unsigned long -__uld8 (const unsigned long * addr) -{ - const struct __una_u64 *ptr = (const struct __una_u64 *) addr; - return ptr->x; -} - -static inline unsigned long -__uld4 (const unsigned int * addr) -{ - const struct __una_u32 *ptr = (const struct __una_u32 *) addr; - return ptr->x; -} - -static inline unsigned long -__uld2 (const unsigned short * addr) -{ - const struct __una_u16 *ptr = (const struct __una_u16 *) addr; - return ptr->x; -} - -static inline void -__ust8 (unsigned long val, unsigned long * addr) -{ - struct __una_u64 *ptr = (struct __una_u64 *) addr; - ptr->x = val; -} - -static inline void -__ust4 (unsigned long val, unsigned int * addr) -{ - struct __una_u32 *ptr = (struct __una_u32 *) addr; - ptr->x = val; -} - -static inline void -__ust2 (unsigned long val, unsigned short * addr) -{ - struct __una_u16 *ptr = (struct __una_u16 *) addr; - ptr->x = val; -} - - -/* - * This function doesn't actually exist. The idea is that when someone uses the macros - * below with an unsupported size (datatype), the linker will alert us to the problem via - * an unresolved reference error. - */ -extern unsigned long ia64_bad_unaligned_access_length (void); - -#define ia64_get_unaligned(_ptr,size) \ -({ \ - const void *__ia64_ptr = (_ptr); \ - unsigned long __ia64_val; \ - \ - switch (size) { \ - case 1: \ - __ia64_val = *(const unsigned char *) __ia64_ptr; \ - break; \ - case 2: \ - __ia64_val = __uld2((const unsigned short *)__ia64_ptr); \ - break; \ - case 4: \ - __ia64_val = __uld4((const unsigned int *)__ia64_ptr); \ - break; \ - case 8: \ - __ia64_val = __uld8((const unsigned long *)__ia64_ptr); \ - break; \ - default: \ - __ia64_val = ia64_bad_unaligned_access_length(); \ - } \ - __ia64_val; \ -}) - -#define ia64_put_unaligned(_val,_ptr,size) \ -do { \ - const void *__ia64_ptr = (_ptr); \ - unsigned long __ia64_val = (_val); \ - \ - switch (size) { \ - case 1: \ - *(unsigned char *)__ia64_ptr = (__ia64_val); \ - break; \ - case 2: \ - __ust2(__ia64_val, (unsigned short *)__ia64_ptr); \ - break; \ - case 4: \ - __ust4(__ia64_val, (unsigned int *)__ia64_ptr); \ - break; \ - case 8: \ - __ust8(__ia64_val, (unsigned long *)__ia64_ptr); \ - break; \ - default: \ - ia64_bad_unaligned_access_length(); \ - } \ -} while (0) +#include #endif /* _ASM_IA64_UNALIGNED_H */ diff --git a/xen/include/asm-ia64/linux/asm/unistd.h b/xen/include/asm-ia64/linux/asm/unistd.h index 863f3b95a0..3a0c695246 100644 --- a/xen/include/asm-ia64/linux/asm/unistd.h +++ b/xen/include/asm-ia64/linux/asm/unistd.h @@ -263,6 +263,12 @@ #define __NR_add_key 1271 #define __NR_request_key 1272 #define __NR_keyctl 1273 +#define __NR_ioprio_set 1274 +#define __NR_ioprio_get 1275 +#define __NR_set_zone_reclaim 1276 +#define __NR_inotify_init 1277 +#define __NR_inotify_add_watch 1278 +#define __NR_inotify_rm_watch 1279 #ifdef __KERNEL__ @@ -392,7 +398,7 @@ asmlinkage long sys_rt_sigaction(int sig, * proper prototype, but we can't use __typeof__ either, because not all cond_syscall() * declarations have prototypes at the moment. */ -#define cond_syscall(x) asmlinkage long x (void) __attribute__((weak,alias("sys_ni_syscall"))); +#define cond_syscall(x) asmlinkage long x (void) __attribute__((weak,alias("sys_ni_syscall"))) #endif /* !__ASSEMBLY__ */ #endif /* __KERNEL__ */ diff --git a/xen/include/asm-ia64/linux/bitmap.h b/xen/include/asm-ia64/linux/bitmap.h index 77401c1551..86dd5502b0 100644 --- a/xen/include/asm-ia64/linux/bitmap.h +++ b/xen/include/asm-ia64/linux/bitmap.h @@ -41,7 +41,9 @@ * bitmap_shift_right(dst, src, n, nbits) *dst = *src >> n * bitmap_shift_left(dst, src, n, nbits) *dst = *src << n * bitmap_scnprintf(buf, len, src, nbits) Print bitmap src to buf - * bitmap_parse(ubuf, ulen, dst, nbits) Parse bitmap dst from buf + * bitmap_parse(ubuf, ulen, dst, nbits) Parse bitmap dst from user buf + * bitmap_scnlistprintf(buf, len, src, nbits) Print bitmap src as list to buf + * bitmap_parselist(buf, dst, nbits) Parse bitmap dst from list */ /* @@ -98,6 +100,10 @@ extern int bitmap_scnprintf(char *buf, unsigned int len, const unsigned long *src, int nbits); extern int bitmap_parse(const char __user *ubuf, unsigned int ulen, unsigned long *dst, int nbits); +extern int bitmap_scnlistprintf(char *buf, unsigned int len, + const unsigned long *src, int nbits); +extern int bitmap_parselist(const char *buf, unsigned long *maskp, + int nmaskbits); extern int bitmap_find_free_region(unsigned long *bitmap, int bits, int order); extern void bitmap_release_region(unsigned long *bitmap, int pos, int order); extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order); diff --git a/xen/include/asm-ia64/linux/bitops.h b/xen/include/asm-ia64/linux/bitops.h index 48f87b979c..cb3c3ef50f 100644 --- a/xen/include/asm-ia64/linux/bitops.h +++ b/xen/include/asm-ia64/linux/bitops.h @@ -134,4 +134,26 @@ static inline unsigned long hweight_long(unsigned long w) return sizeof(w) == 4 ? generic_hweight32(w) : generic_hweight64(w); } +/* + * rol32 - rotate a 32-bit value left + * + * @word: value to rotate + * @shift: bits to roll + */ +static inline __u32 rol32(__u32 word, unsigned int shift) +{ + return (word << shift) | (word >> (32 - shift)); +} + +/* + * ror32 - rotate a 32-bit value right + * + * @word: value to rotate + * @shift: bits to roll + */ +static inline __u32 ror32(__u32 word, unsigned int shift) +{ + return (word >> shift) | (word << (32 - shift)); +} + #endif diff --git a/xen/include/asm-ia64/linux/dma-mapping.h b/xen/include/asm-ia64/linux/dma-mapping.h index 806c305332..2d80cc761a 100644 --- a/xen/include/asm-ia64/linux/dma-mapping.h +++ b/xen/include/asm-ia64/linux/dma-mapping.h @@ -14,7 +14,12 @@ enum dma_data_direction { }; #define DMA_64BIT_MASK 0xffffffffffffffffULL +#define DMA_40BIT_MASK 0x000000ffffffffffULL +#define DMA_39BIT_MASK 0x0000007fffffffffULL #define DMA_32BIT_MASK 0x00000000ffffffffULL +#define DMA_31BIT_MASK 0x000000007fffffffULL +#define DMA_30BIT_MASK 0x000000003fffffffULL +#define DMA_29BIT_MASK 0x000000001fffffffULL #include diff --git a/xen/include/asm-ia64/linux/efi.h b/xen/include/asm-ia64/linux/efi.h index 0f461df768..73781ec165 100644 --- a/xen/include/asm-ia64/linux/efi.h +++ b/xen/include/asm-ia64/linux/efi.h @@ -301,7 +301,6 @@ extern u64 efi_mem_attributes (unsigned long phys_addr); extern int __init efi_uart_console_only (void); extern void efi_initialize_iomem_resources(struct resource *code_resource, struct resource *data_resource); -extern efi_status_t phys_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc); extern unsigned long __init efi_get_time(void); extern int __init efi_set_rtc_mmss(unsigned long nowtime); extern struct efi_memory_map memmap; @@ -316,7 +315,7 @@ extern struct efi_memory_map memmap; */ static inline int efi_range_is_wc(unsigned long start, unsigned long len) { - int i; + unsigned long i; for (i = 0; i < len; i += (1UL << EFI_PAGE_SHIFT)) { unsigned long paddr = __pa(start + i); diff --git a/xen/include/asm-ia64/linux/err.h b/xen/include/asm-ia64/linux/err.h index 17c55df136..ff71d2af5d 100644 --- a/xen/include/asm-ia64/linux/err.h +++ b/xen/include/asm-ia64/linux/err.h @@ -13,6 +13,8 @@ * This should be a per-architecture thing, to allow different * error and pointer decisions. */ +#define IS_ERR_VALUE(x) unlikely((x) > (unsigned long)-1000L) + static inline void *ERR_PTR(long error) { return (void *) error; @@ -25,7 +27,7 @@ static inline long PTR_ERR(const void *ptr) static inline long IS_ERR(const void *ptr) { - return unlikely((unsigned long)ptr > (unsigned long)-1000L); + return IS_ERR_VALUE((unsigned long)ptr); } #endif /* _LINUX_ERR_H */ diff --git a/xen/include/asm-ia64/linux/gfp.h b/xen/include/asm-ia64/linux/gfp.h index b526b21bad..7c7400137e 100644 --- a/xen/include/asm-ia64/linux/gfp.h +++ b/xen/include/asm-ia64/linux/gfp.h @@ -12,8 +12,8 @@ struct vm_area_struct; * GFP bitmasks.. */ /* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low two bits) */ -#define __GFP_DMA 0x01 -#define __GFP_HIGHMEM 0x02 +#define __GFP_DMA 0x01u +#define __GFP_HIGHMEM 0x02u /* * Action modifiers - doesn't change the zoning @@ -26,26 +26,29 @@ struct vm_area_struct; * * __GFP_NORETRY: The VM implementation must not retry indefinitely. */ -#define __GFP_WAIT 0x10 /* Can wait and reschedule? */ -#define __GFP_HIGH 0x20 /* Should access emergency pools? */ -#define __GFP_IO 0x40 /* Can start physical IO? */ -#define __GFP_FS 0x80 /* Can call down to low-level FS? */ -#define __GFP_COLD 0x100 /* Cache-cold page required */ -#define __GFP_NOWARN 0x200 /* Suppress page allocation failure warning */ -#define __GFP_REPEAT 0x400 /* Retry the allocation. Might fail */ -#define __GFP_NOFAIL 0x800 /* Retry for ever. Cannot fail */ -#define __GFP_NORETRY 0x1000 /* Do not retry. Might fail */ -#define __GFP_NO_GROW 0x2000 /* Slab internal usage */ -#define __GFP_COMP 0x4000 /* Add compound page metadata */ -#define __GFP_ZERO 0x8000 /* Return zeroed page on success */ - -#define __GFP_BITS_SHIFT 16 /* Room for 16 __GFP_FOO bits */ +#define __GFP_WAIT 0x10u /* Can wait and reschedule? */ +#define __GFP_HIGH 0x20u /* Should access emergency pools? */ +#define __GFP_IO 0x40u /* Can start physical IO? */ +#define __GFP_FS 0x80u /* Can call down to low-level FS? */ +#define __GFP_COLD 0x100u /* Cache-cold page required */ +#define __GFP_NOWARN 0x200u /* Suppress page allocation failure warning */ +#define __GFP_REPEAT 0x400u /* Retry the allocation. Might fail */ +#define __GFP_NOFAIL 0x800u /* Retry for ever. Cannot fail */ +#define __GFP_NORETRY 0x1000u /* Do not retry. Might fail */ +#define __GFP_NO_GROW 0x2000u /* Slab internal usage */ +#define __GFP_COMP 0x4000u /* Add compound page metadata */ +#define __GFP_ZERO 0x8000u /* Return zeroed page on success */ +#define __GFP_NOMEMALLOC 0x10000u /* Don't use emergency reserves */ +#define __GFP_NORECLAIM 0x20000u /* No realy zone reclaim during allocation */ + +#define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ #define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1) /* if you forget to add the bitmask here kernel will crash, period */ #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ - __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP) + __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ + __GFP_NOMEMALLOC|__GFP_NORECLAIM) #define GFP_ATOMIC (__GFP_HIGH) #define GFP_NOIO (__GFP_WAIT) @@ -82,7 +85,7 @@ static inline void arch_free_page(struct page *page, int order) { } extern struct page * FASTCALL(__alloc_pages(unsigned int, unsigned int, struct zonelist *)); -static inline struct page *alloc_pages_node(int nid, unsigned int gfp_mask, +static inline struct page *alloc_pages_node(int nid, unsigned int __nocast gfp_mask, unsigned int order) { if (unlikely(order >= MAX_ORDER)) @@ -93,17 +96,17 @@ static inline struct page *alloc_pages_node(int nid, unsigned int gfp_mask, } #ifdef CONFIG_NUMA -extern struct page *alloc_pages_current(unsigned gfp_mask, unsigned order); +extern struct page *alloc_pages_current(unsigned int __nocast gfp_mask, unsigned order); static inline struct page * -alloc_pages(unsigned int gfp_mask, unsigned int order) +alloc_pages(unsigned int __nocast gfp_mask, unsigned int order) { if (unlikely(order >= MAX_ORDER)) return NULL; return alloc_pages_current(gfp_mask, order); } -extern struct page *alloc_page_vma(unsigned gfp_mask, +extern struct page *alloc_page_vma(unsigned __nocast gfp_mask, struct vm_area_struct *vma, unsigned long addr); #else #define alloc_pages(gfp_mask, order) \ @@ -112,8 +115,8 @@ extern struct page *alloc_page_vma(unsigned gfp_mask, #endif #define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0) -extern unsigned long FASTCALL(__get_free_pages(unsigned int gfp_mask, unsigned int order)); -extern unsigned long FASTCALL(get_zeroed_page(unsigned int gfp_mask)); +extern unsigned long FASTCALL(__get_free_pages(unsigned int __nocast gfp_mask, unsigned int order)); +extern unsigned long FASTCALL(get_zeroed_page(unsigned int __nocast gfp_mask)); #define __get_free_page(gfp_mask) \ __get_free_pages((gfp_mask),0) @@ -130,5 +133,10 @@ extern void FASTCALL(free_cold_page(struct page *page)); #define free_page(addr) free_pages((addr),0) void page_alloc_init(void); +#ifdef CONFIG_NUMA +void drain_remote_pages(void); +#else +static inline void drain_remote_pages(void) { }; +#endif #endif /* __LINUX_GFP_H */ diff --git a/xen/include/asm-ia64/linux/mmzone.h b/xen/include/asm-ia64/linux/mmzone.h index a2b35dbc84..6c90461ed9 100644 --- a/xen/include/asm-ia64/linux/mmzone.h +++ b/xen/include/asm-ia64/linux/mmzone.h @@ -11,6 +11,7 @@ #include #include #include +#include #include /* Free memory management - zoned buddy allocator. */ @@ -62,6 +63,12 @@ struct per_cpu_pageset { #endif } ____cacheline_aligned_in_smp; +#ifdef CONFIG_NUMA +#define zone_pcp(__z, __cpu) ((__z)->pageset[(__cpu)]) +#else +#define zone_pcp(__z, __cpu) (&(__z)->pageset[(__cpu)]) +#endif + #define ZONE_DMA 0 #define ZONE_NORMAL 1 #define ZONE_HIGHMEM 2 @@ -121,8 +128,11 @@ struct zone { */ unsigned long lowmem_reserve[MAX_NR_ZONES]; +#ifdef CONFIG_NUMA + struct per_cpu_pageset *pageset[NR_CPUS]; +#else struct per_cpu_pageset pageset[NR_CPUS]; - +#endif /* * free areas of different sizes */ @@ -143,6 +153,14 @@ struct zone { unsigned long pages_scanned; /* since last reclaim */ int all_unreclaimable; /* All pages pinned */ + /* + * Does the allocator try to reclaim pages from the zone as soon + * as it fails a watermark_ok() in __alloc_pages? + */ + int reclaim_pages; + /* A count of how many reclaimers are scanning this zone */ + atomic_t reclaim_in_progress; + /* * prev_priority holds the scanning priority for this zone. It is * defined as the scanning priority at which we achieved our reclaim @@ -251,7 +269,9 @@ typedef struct pglist_data { struct zone node_zones[MAX_NR_ZONES]; struct zonelist node_zonelists[GFP_ZONETYPES]; int nr_zones; +#ifdef CONFIG_FLAT_NODE_MEM_MAP struct page *node_mem_map; +#endif struct bootmem_data *bdata; unsigned long node_start_pfn; unsigned long node_present_pages; /* total number of physical pages */ @@ -266,6 +286,12 @@ typedef struct pglist_data { #define node_present_pages(nid) (NODE_DATA(nid)->node_present_pages) #define node_spanned_pages(nid) (NODE_DATA(nid)->node_spanned_pages) +#ifdef CONFIG_FLAT_NODE_MEM_MAP +#define pgdat_page_nr(pgdat, pagenr) ((pgdat)->node_mem_map + (pagenr)) +#else +#define pgdat_page_nr(pgdat, pagenr) pfn_to_page((pgdat)->node_start_pfn + (pagenr)) +#endif +#define nid_page_nr(nid, pagenr) pgdat_page_nr(NODE_DATA(nid),(pagenr)) extern struct pglist_data *pgdat_list; @@ -278,6 +304,16 @@ void wakeup_kswapd(struct zone *zone, int order); int zone_watermark_ok(struct zone *z, int order, unsigned long mark, int alloc_type, int can_try_harder, int gfp_high); +#ifdef CONFIG_HAVE_MEMORY_PRESENT +void memory_present(int nid, unsigned long start, unsigned long end); +#else +static inline void memory_present(int nid, unsigned long start, unsigned long end) {} +#endif + +#ifdef CONFIG_NEED_NODE_MEMMAP_SIZE +unsigned long __init node_memmap_size_bytes(int, unsigned long, unsigned long); +#endif + /* * zone_idx() returns 0 for the ZONE_DMA zone, 1 for the ZONE_NORMAL zone, etc. */ @@ -370,9 +406,9 @@ int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, struct file *, #include /* Returns the number of the current Node. */ -#define numa_node_id() (cpu_to_node(_smp_processor_id())) +#define numa_node_id() (cpu_to_node(raw_smp_processor_id())) -#ifndef CONFIG_DISCONTIGMEM +#ifndef CONFIG_NEED_MULTIPLE_NODES extern struct pglist_data contig_page_data; #define NODE_DATA(nid) (&contig_page_data) @@ -380,36 +416,177 @@ extern struct pglist_data contig_page_data; #define MAX_NODES_SHIFT 1 #define pfn_to_nid(pfn) (0) -#else /* CONFIG_DISCONTIGMEM */ +#else /* CONFIG_NEED_MULTIPLE_NODES */ #include +#endif /* !CONFIG_NEED_MULTIPLE_NODES */ + +#ifdef CONFIG_SPARSEMEM +#include +#endif + #if BITS_PER_LONG == 32 || defined(ARCH_HAS_ATOMIC_UNSIGNED) /* * with 32 bit page->flags field, we reserve 8 bits for node/zone info. * there are 3 zones (2 bits) and this leaves 8-2=6 bits for nodes. */ -#define MAX_NODES_SHIFT 6 +#define FLAGS_RESERVED 8 + #elif BITS_PER_LONG == 64 /* * with 64 bit flags field, there's plenty of room. */ -#define MAX_NODES_SHIFT 10 +#define FLAGS_RESERVED 32 + +#else + +#error BITS_PER_LONG not defined + +#endif + +#ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID +#define early_pfn_to_nid(nid) (0UL) #endif -#endif /* !CONFIG_DISCONTIGMEM */ +#define pfn_to_section_nr(pfn) ((pfn) >> PFN_SECTION_SHIFT) +#define section_nr_to_pfn(sec) ((sec) << PFN_SECTION_SHIFT) + +#ifdef CONFIG_SPARSEMEM + +/* + * SECTION_SHIFT #bits space required to store a section # + * + * PA_SECTION_SHIFT physical address to/from section number + * PFN_SECTION_SHIFT pfn to/from section number + */ +#define SECTIONS_SHIFT (MAX_PHYSMEM_BITS - SECTION_SIZE_BITS) + +#define PA_SECTION_SHIFT (SECTION_SIZE_BITS) +#define PFN_SECTION_SHIFT (SECTION_SIZE_BITS - PAGE_SHIFT) + +#define NR_MEM_SECTIONS (1UL << SECTIONS_SHIFT) -#if NODES_SHIFT > MAX_NODES_SHIFT -#error NODES_SHIFT > MAX_NODES_SHIFT +#define PAGES_PER_SECTION (1UL << PFN_SECTION_SHIFT) +#define PAGE_SECTION_MASK (~(PAGES_PER_SECTION-1)) + +#if (MAX_ORDER - 1 + PAGE_SHIFT) > SECTION_SIZE_BITS +#error Allocator MAX_ORDER exceeds SECTION_SIZE #endif -/* There are currently 3 zones: DMA, Normal & Highmem, thus we need 2 bits */ -#define MAX_ZONES_SHIFT 2 +struct page; +struct mem_section { + /* + * This is, logically, a pointer to an array of struct + * pages. However, it is stored with some other magic. + * (see sparse.c::sparse_init_one_section()) + * + * Making it a UL at least makes someone do a cast + * before using it wrong. + */ + unsigned long section_mem_map; +}; -#if ZONES_SHIFT > MAX_ZONES_SHIFT -#error ZONES_SHIFT > MAX_ZONES_SHIFT +extern struct mem_section mem_section[NR_MEM_SECTIONS]; + +static inline struct mem_section *__nr_to_section(unsigned long nr) +{ + return &mem_section[nr]; +} + +/* + * We use the lower bits of the mem_map pointer to store + * a little bit of information. There should be at least + * 3 bits here due to 32-bit alignment. + */ +#define SECTION_MARKED_PRESENT (1UL<<0) +#define SECTION_HAS_MEM_MAP (1UL<<1) +#define SECTION_MAP_LAST_BIT (1UL<<2) +#define SECTION_MAP_MASK (~(SECTION_MAP_LAST_BIT-1)) + +static inline struct page *__section_mem_map_addr(struct mem_section *section) +{ + unsigned long map = section->section_mem_map; + map &= SECTION_MAP_MASK; + return (struct page *)map; +} + +static inline int valid_section(struct mem_section *section) +{ + return (section->section_mem_map & SECTION_MARKED_PRESENT); +} + +static inline int section_has_mem_map(struct mem_section *section) +{ + return (section->section_mem_map & SECTION_HAS_MEM_MAP); +} + +static inline int valid_section_nr(unsigned long nr) +{ + return valid_section(__nr_to_section(nr)); +} + +/* + * Given a kernel address, find the home node of the underlying memory. + */ +#define kvaddr_to_nid(kaddr) pfn_to_nid(__pa(kaddr) >> PAGE_SHIFT) + +static inline struct mem_section *__pfn_to_section(unsigned long pfn) +{ + return __nr_to_section(pfn_to_section_nr(pfn)); +} + +#define pfn_to_page(pfn) \ +({ \ + unsigned long __pfn = (pfn); \ + __section_mem_map_addr(__pfn_to_section(__pfn)) + __pfn; \ +}) +#define page_to_pfn(page) \ +({ \ + page - __section_mem_map_addr(__nr_to_section( \ + page_to_section(page))); \ +}) + +static inline int pfn_valid(unsigned long pfn) +{ + if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS) + return 0; + return valid_section(__nr_to_section(pfn_to_section_nr(pfn))); +} + +/* + * These are _only_ used during initialisation, therefore they + * can use __initdata ... They could have names to indicate + * this restriction. + */ +#ifdef CONFIG_NUMA +#define pfn_to_nid early_pfn_to_nid +#endif + +#define pfn_to_pgdat(pfn) \ +({ \ + NODE_DATA(pfn_to_nid(pfn)); \ +}) + +#define early_pfn_valid(pfn) pfn_valid(pfn) +void sparse_init(void); +#else +#define sparse_init() do {} while (0) +#endif /* CONFIG_SPARSEMEM */ + +#ifdef CONFIG_NODES_SPAN_OTHER_NODES +#define early_pfn_in_nid(pfn, nid) (early_pfn_to_nid(pfn) == (nid)) +#else +#define early_pfn_in_nid(pfn, nid) (1) #endif +#ifndef early_pfn_valid +#define early_pfn_valid(pfn) (1) +#endif + +void memory_present(int nid, unsigned long start, unsigned long end); +unsigned long __init node_memmap_size_bytes(int, unsigned long, unsigned long); + #endif /* !__ASSEMBLY__ */ #endif /* __KERNEL__ */ #endif /* _LINUX_MMZONE_H */ diff --git a/xen/include/asm-ia64/linux/numa.h b/xen/include/asm-ia64/linux/numa.h index bd0c8c4e9a..f0c539bd3c 100644 --- a/xen/include/asm-ia64/linux/numa.h +++ b/xen/include/asm-ia64/linux/numa.h @@ -3,7 +3,7 @@ #include -#ifdef CONFIG_DISCONTIGMEM +#ifndef CONFIG_FLATMEM #include #endif diff --git a/xen/include/asm-ia64/linux/page-flags.h b/xen/include/asm-ia64/linux/page-flags.h index 6ab9cc4664..f5a6695d4d 100644 --- a/xen/include/asm-ia64/linux/page-flags.h +++ b/xen/include/asm-ia64/linux/page-flags.h @@ -61,21 +61,20 @@ #define PG_active 6 #define PG_slab 7 /* slab debug (Suparna wants this) */ -#define PG_highmem 8 -#define PG_checked 9 /* kill me in 2.5.. */ -#define PG_arch_1 10 -#define PG_reserved 11 +#define PG_checked 8 /* kill me in 2.5.. */ +#define PG_arch_1 9 +#define PG_reserved 10 +#define PG_private 11 /* Has something at ->private */ -#define PG_private 12 /* Has something at ->private */ -#define PG_writeback 13 /* Page is under writeback */ -#define PG_nosave 14 /* Used for system suspend/resume */ -#define PG_compound 15 /* Part of a compound page */ - -#define PG_swapcache 16 /* Swap page: swp_entry_t in private */ -#define PG_mappedtodisk 17 /* Has blocks allocated on-disk */ -#define PG_reclaim 18 /* To be reclaimed asap */ -#define PG_nosave_free 19 /* Free, should not be written */ +#define PG_writeback 12 /* Page is under writeback */ +#define PG_nosave 13 /* Used for system suspend/resume */ +#define PG_compound 14 /* Part of a compound page */ +#define PG_swapcache 15 /* Swap page: swp_entry_t in private */ +#define PG_mappedtodisk 16 /* Has blocks allocated on-disk */ +#define PG_reclaim 17 /* To be reclaimed asap */ +#define PG_nosave_free 18 /* Free, should not be written */ +#define PG_uncached 19 /* Page has been mapped as uncached */ /* * Global page accounting. One instance per CPU. Only unsigned longs are @@ -131,12 +130,13 @@ struct page_state { unsigned long allocstall; /* direct reclaim calls */ unsigned long pgrotated; /* pages rotated to tail of the LRU */ + unsigned long nr_bounce; /* pages for bounce buffers */ }; extern void get_page_state(struct page_state *ret); extern void get_full_page_state(struct page_state *ret); -extern unsigned long __read_page_state(unsigned offset); -extern void __mod_page_state(unsigned offset, unsigned long delta); +extern unsigned long __read_page_state(unsigned long offset); +extern void __mod_page_state(unsigned long offset, unsigned long delta); #define read_page_state(member) \ __read_page_state(offsetof(struct page_state, member)) @@ -214,7 +214,7 @@ extern void __mod_page_state(unsigned offset, unsigned long delta); #define TestSetPageSlab(page) test_and_set_bit(PG_slab, &(page)->flags) #ifdef CONFIG_HIGHMEM -#define PageHighMem(page) test_bit(PG_highmem, &(page)->flags) +#define PageHighMem(page) is_highmem(page_zone(page)) #else #define PageHighMem(page) 0 /* needed to optimize away at compile time */ #endif @@ -301,10 +301,13 @@ extern void __mod_page_state(unsigned offset, unsigned long delta); #define PageSwapCache(page) 0 #endif +#define PageUncached(page) test_bit(PG_uncached, &(page)->flags) +#define SetPageUncached(page) set_bit(PG_uncached, &(page)->flags) +#define ClearPageUncached(page) clear_bit(PG_uncached, &(page)->flags) + struct page; /* forward declaration */ int test_clear_page_dirty(struct page *page); -int __clear_page_dirty(struct page *page); int test_clear_page_writeback(struct page *page); int test_set_page_writeback(struct page *page); diff --git a/xen/include/asm-ia64/linux/slab.h b/xen/include/asm-ia64/linux/slab.h index a3239a4cbc..80b2dfde2e 100644 --- a/xen/include/asm-ia64/linux/slab.h +++ b/xen/include/asm-ia64/linux/slab.h @@ -1,3 +1,137 @@ -#include -#include -#include +/* + * linux/mm/slab.h + * Written by Mark Hemment, 1996. + * (markhe@nextd.demon.co.uk) + */ + +#ifndef _LINUX_SLAB_H +#define _LINUX_SLAB_H + +#if defined(__KERNEL__) + +typedef struct kmem_cache_s kmem_cache_t; + +#include /* kmalloc_sizes.h needs CONFIG_ options */ +#include +#include +#include +#include /* kmalloc_sizes.h needs PAGE_SIZE */ +#include /* kmalloc_sizes.h needs L1_CACHE_BYTES */ + +/* flags for kmem_cache_alloc() */ +#define SLAB_NOFS GFP_NOFS +#define SLAB_NOIO GFP_NOIO +#define SLAB_ATOMIC GFP_ATOMIC +#define SLAB_USER GFP_USER +#define SLAB_KERNEL GFP_KERNEL +#define SLAB_DMA GFP_DMA + +#define SLAB_LEVEL_MASK GFP_LEVEL_MASK + +#define SLAB_NO_GROW __GFP_NO_GROW /* don't grow a cache */ + +/* flags to pass to kmem_cache_create(). + * The first 3 are only valid when the allocator as been build + * SLAB_DEBUG_SUPPORT. + */ +#define SLAB_DEBUG_FREE 0x00000100UL /* Peform (expensive) checks on free */ +#define SLAB_DEBUG_INITIAL 0x00000200UL /* Call constructor (as verifier) */ +#define SLAB_RED_ZONE 0x00000400UL /* Red zone objs in a cache */ +#define SLAB_POISON 0x00000800UL /* Poison objects */ +#define SLAB_NO_REAP 0x00001000UL /* never reap from the cache */ +#define SLAB_HWCACHE_ALIGN 0x00002000UL /* align objs on a h/w cache lines */ +#define SLAB_CACHE_DMA 0x00004000UL /* use GFP_DMA memory */ +#define SLAB_MUST_HWCACHE_ALIGN 0x00008000UL /* force alignment */ +#define SLAB_STORE_USER 0x00010000UL /* store the last owner for bug hunting */ +#define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* track pages allocated to indicate + what is reclaimable later*/ +#define SLAB_PANIC 0x00040000UL /* panic if kmem_cache_create() fails */ +#define SLAB_DESTROY_BY_RCU 0x00080000UL /* defer freeing pages to RCU */ + +/* flags passed to a constructor func */ +#define SLAB_CTOR_CONSTRUCTOR 0x001UL /* if not set, then deconstructor */ +#define SLAB_CTOR_ATOMIC 0x002UL /* tell constructor it can't sleep */ +#define SLAB_CTOR_VERIFY 0x004UL /* tell constructor it's a verify call */ + +/* prototypes */ +extern void __init kmem_cache_init(void); + +extern kmem_cache_t *kmem_cache_create(const char *, size_t, size_t, unsigned long, + void (*)(void *, kmem_cache_t *, unsigned long), + void (*)(void *, kmem_cache_t *, unsigned long)); +extern int kmem_cache_destroy(kmem_cache_t *); +extern int kmem_cache_shrink(kmem_cache_t *); +extern void *kmem_cache_alloc(kmem_cache_t *, unsigned int __nocast); +extern void kmem_cache_free(kmem_cache_t *, void *); +extern unsigned int kmem_cache_size(kmem_cache_t *); +extern const char *kmem_cache_name(kmem_cache_t *); +extern kmem_cache_t *kmem_find_general_cachep(size_t size, unsigned int __nocast gfpflags); + +/* Size description struct for general caches. */ +struct cache_sizes { + size_t cs_size; + kmem_cache_t *cs_cachep; + kmem_cache_t *cs_dmacachep; +}; +extern struct cache_sizes malloc_sizes[]; +extern void *__kmalloc(size_t, unsigned int __nocast); + +static inline void *kmalloc(size_t size, unsigned int __nocast flags) +{ + if (__builtin_constant_p(size)) { + int i = 0; +#define CACHE(x) \ + if (size <= x) \ + goto found; \ + else \ + i++; +#include "kmalloc_sizes.h" +#undef CACHE + { + extern void __you_cannot_kmalloc_that_much(void); + __you_cannot_kmalloc_that_much(); + } +found: + return kmem_cache_alloc((flags & GFP_DMA) ? + malloc_sizes[i].cs_dmacachep : + malloc_sizes[i].cs_cachep, flags); + } + return __kmalloc(size, flags); +} + +extern void *kcalloc(size_t, size_t, unsigned int __nocast); +extern void kfree(const void *); +extern unsigned int ksize(const void *); + +#ifdef CONFIG_NUMA +extern void *kmem_cache_alloc_node(kmem_cache_t *, int flags, int node); +extern void *kmalloc_node(size_t size, unsigned int __nocast flags, int node); +#else +static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, int flags, int node) +{ + return kmem_cache_alloc(cachep, flags); +} +static inline void *kmalloc_node(size_t size, unsigned int __nocast flags, int node) +{ + return kmalloc(size, flags); +} +#endif + +extern int FASTCALL(kmem_cache_reap(int)); +extern int FASTCALL(kmem_ptr_validate(kmem_cache_t *cachep, void *ptr)); + +/* System wide caches */ +extern kmem_cache_t *vm_area_cachep; +extern kmem_cache_t *names_cachep; +extern kmem_cache_t *files_cachep; +extern kmem_cache_t *filp_cachep; +extern kmem_cache_t *fs_cachep; +extern kmem_cache_t *signal_cachep; +extern kmem_cache_t *sighand_cachep; +extern kmem_cache_t *bio_cachep; + +extern atomic_t slab_reclaim_pages; + +#endif /* __KERNEL__ */ + +#endif /* _LINUX_SLAB_H */ diff --git a/xen/include/asm-ia64/linux/threads.h b/xen/include/asm-ia64/linux/threads.h index 4243c55cce..b59738ac61 100644 --- a/xen/include/asm-ia64/linux/threads.h +++ b/xen/include/asm-ia64/linux/threads.h @@ -7,7 +7,7 @@ * The default limit for the nr of threads is now in * /proc/sys/kernel/threads-max. */ - + /* * Maximum supported processors that can run under SMP. This value is * set via configure setting. The maximum is equal to the size of the @@ -25,11 +25,12 @@ /* * This controls the default maximum pid allocated to a process */ -#define PID_MAX_DEFAULT 0x8000 +#define PID_MAX_DEFAULT (CONFIG_BASE_SMALL ? 0x1000 : 0x8000) /* * A maximum of 4 million PIDs should be enough for a while: */ -#define PID_MAX_LIMIT (sizeof(long) > 4 ? 4*1024*1024 : PID_MAX_DEFAULT) +#define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \ + (sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT)) #endif diff --git a/xen/include/asm-ia64/linux/linuxtime.h b/xen/include/asm-ia64/linux/time.h similarity index 100% rename from xen/include/asm-ia64/linux/linuxtime.h rename to xen/include/asm-ia64/linux/time.h diff --git a/xen/include/asm-ia64/linux/timex.h b/xen/include/asm-ia64/linux/timex.h index b54c288dd6..74fdd07d37 100644 --- a/xen/include/asm-ia64/linux/timex.h +++ b/xen/include/asm-ia64/linux/timex.h @@ -240,9 +240,7 @@ extern long time_precision; /* clock precision (us) */ extern long time_maxerror; /* maximum error */ extern long time_esterror; /* estimated error */ -extern long time_phase; /* phase offset (scaled us) */ extern long time_freq; /* frequency offset (scaled ppm) */ -extern long time_adj; /* tick adjust (scaled 1 / HZ) */ extern long time_reftime; /* time at last adjustment (s) */ extern long time_adjust; /* The amount of adjtime left */ diff --git a/xen/include/asm-ia64/linux/topology.h b/xen/include/asm-ia64/linux/topology.h index 295f4c05c7..0320225e96 100644 --- a/xen/include/asm-ia64/linux/topology.h +++ b/xen/include/asm-ia64/linux/topology.h @@ -31,9 +31,12 @@ #include #include #include - #include +#ifndef node_has_online_mem +#define node_has_online_mem(nid) (1) +#endif + #ifndef nr_cpus_node #define nr_cpus_node(node) \ ({ \ @@ -86,6 +89,11 @@ .cache_hot_time = 0, \ .cache_nice_tries = 0, \ .per_cpu_gain = 25, \ + .busy_idx = 0, \ + .idle_idx = 0, \ + .newidle_idx = 1, \ + .wake_idx = 0, \ + .forkexec_idx = 0, \ .flags = SD_LOAD_BALANCE \ | SD_BALANCE_NEWIDLE \ | SD_BALANCE_EXEC \ @@ -112,12 +120,15 @@ .cache_hot_time = (5*1000000/2), \ .cache_nice_tries = 1, \ .per_cpu_gain = 100, \ + .busy_idx = 2, \ + .idle_idx = 1, \ + .newidle_idx = 2, \ + .wake_idx = 1, \ + .forkexec_idx = 1, \ .flags = SD_LOAD_BALANCE \ | SD_BALANCE_NEWIDLE \ | SD_BALANCE_EXEC \ - | SD_WAKE_AFFINE \ - | SD_WAKE_IDLE \ - | SD_WAKE_BALANCE, \ + | SD_WAKE_AFFINE, \ .last_balance = jiffies, \ .balance_interval = 1, \ .nr_balance_failed = 0, \ diff --git a/xen/include/asm-ia64/linux/wait.h b/xen/include/asm-ia64/linux/wait.h index ddb0a16f31..d38c9fecdc 100644 --- a/xen/include/asm-ia64/linux/wait.h +++ b/xen/include/asm-ia64/linux/wait.h @@ -33,7 +33,7 @@ int default_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key struct __wait_queue { unsigned int flags; #define WQ_FLAG_EXCLUSIVE 0x01 - struct task_struct * task; + void *private; wait_queue_func_t func; struct list_head task_list; }; @@ -60,7 +60,7 @@ typedef struct __wait_queue_head wait_queue_head_t; */ #define __WAITQUEUE_INITIALIZER(name, tsk) { \ - .task = tsk, \ + .private = tsk, \ .func = default_wake_function, \ .task_list = { NULL, NULL } } @@ -79,14 +79,14 @@ typedef struct __wait_queue_head wait_queue_head_t; static inline void init_waitqueue_head(wait_queue_head_t *q) { - q->lock = SPIN_LOCK_UNLOCKED; + spin_lock_init(&q->lock); INIT_LIST_HEAD(&q->task_list); } static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p) { q->flags = 0; - q->task = p; + q->private = p; q->func = default_wake_function; } @@ -94,7 +94,7 @@ static inline void init_waitqueue_func_entry(wait_queue_t *q, wait_queue_func_t func) { q->flags = 0; - q->task = NULL; + q->private = NULL; q->func = func; } @@ -110,7 +110,7 @@ static inline int waitqueue_active(wait_queue_head_t *q) * aio specifies a wait queue entry with an async notification * callback routine, not associated with any task. */ -#define is_sync_wait(wait) (!(wait) || ((wait)->task)) +#define is_sync_wait(wait) (!(wait) || ((wait)->private)) extern void FASTCALL(add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)); extern void FASTCALL(add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait)); @@ -169,6 +169,18 @@ do { \ finish_wait(&wq, &__wait); \ } while (0) +/** + * wait_event - sleep until a condition gets true + * @wq: the waitqueue to wait on + * @condition: a C expression for the event to wait for + * + * The process is put to sleep (TASK_UNINTERRUPTIBLE) until the + * @condition evaluates to true. The @condition is checked each time + * the waitqueue @wq is woken up. + * + * wake_up() has to be called after changing any variable that could + * change the result of the wait condition. + */ #define wait_event(wq, condition) \ do { \ if (condition) \ @@ -191,6 +203,22 @@ do { \ finish_wait(&wq, &__wait); \ } while (0) +/** + * wait_event_timeout - sleep until a condition gets true or a timeout elapses + * @wq: the waitqueue to wait on + * @condition: a C expression for the event to wait for + * @timeout: timeout, in jiffies + * + * The process is put to sleep (TASK_UNINTERRUPTIBLE) until the + * @condition evaluates to true. The @condition is checked each time + * the waitqueue @wq is woken up. + * + * wake_up() has to be called after changing any variable that could + * change the result of the wait condition. + * + * The function returns 0 if the @timeout elapsed, and the remaining + * jiffies if the condition evaluated to true before the timeout elapsed. + */ #define wait_event_timeout(wq, condition, timeout) \ ({ \ long __ret = timeout; \ @@ -217,6 +245,21 @@ do { \ finish_wait(&wq, &__wait); \ } while (0) +/** + * wait_event_interruptible - sleep until a condition gets true + * @wq: the waitqueue to wait on + * @condition: a C expression for the event to wait for + * + * The process is put to sleep (TASK_INTERRUPTIBLE) until the + * @condition evaluates to true or a signal is received. + * The @condition is checked each time the waitqueue @wq is woken up. + * + * wake_up() has to be called after changing any variable that could + * change the result of the wait condition. + * + * The function will return -ERESTARTSYS if it was interrupted by a + * signal and 0 if @condition evaluated to true. + */ #define wait_event_interruptible(wq, condition) \ ({ \ int __ret = 0; \ @@ -245,6 +288,23 @@ do { \ finish_wait(&wq, &__wait); \ } while (0) +/** + * wait_event_interruptible_timeout - sleep until a condition gets true or a timeout elapses + * @wq: the waitqueue to wait on + * @condition: a C expression for the event to wait for + * @timeout: timeout, in jiffies + * + * The process is put to sleep (TASK_INTERRUPTIBLE) until the + * @condition evaluates to true or a signal is received. + * The @condition is checked each time the waitqueue @wq is woken up. + * + * wake_up() has to be called after changing any variable that could + * change the result of the wait condition. + * + * The function returns 0 if the @timeout elapsed, -ERESTARTSYS if it + * was interrupted by a signal, and the remaining jiffies otherwise + * if the condition evaluated to true before the timeout elapsed. + */ #define wait_event_interruptible_timeout(wq, condition, timeout) \ ({ \ long __ret = timeout; \ @@ -324,18 +384,16 @@ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); #define DEFINE_WAIT(name) \ wait_queue_t name = { \ - .task = current, \ + .private = current, \ .func = autoremove_wake_function, \ - .task_list = { .next = &(name).task_list, \ - .prev = &(name).task_list, \ - }, \ + .task_list = LIST_HEAD_INIT((name).task_list), \ } #define DEFINE_WAIT_BIT(name, word, bit) \ struct wait_bit_queue name = { \ .key = __WAIT_BIT_KEY_INITIALIZER(word, bit), \ .wait = { \ - .task = current, \ + .private = current, \ .func = wake_bit_function, \ .task_list = \ LIST_HEAD_INIT((name).wait.task_list), \ @@ -344,7 +402,7 @@ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); #define init_wait(wait) \ do { \ - (wait)->task = current; \ + (wait)->private = current; \ (wait)->func = autoremove_wake_function; \ INIT_LIST_HEAD(&(wait)->task_list); \ } while (0) diff --git a/xen/include/asm-ia64/mm.h b/xen/include/asm-ia64/mm.h index 1bb283873d..988b8d57f3 100644 --- a/xen/include/asm-ia64/mm.h +++ b/xen/include/asm-ia64/mm.h @@ -316,6 +316,7 @@ struct vm_area_struct { #define VM_STACK_FLAGS (VM_GROWSDOWN | VM_STACK_DEFAULT_FLAGS | VM_ACCOUNT) #endif +#if 0 /* removed when rebasing to 2.6.13 */ /* * The zone field is never updated after free_area_init_core() * sets it, so none of the operations on it need to be atomic. @@ -347,6 +348,7 @@ static inline void set_page_zone(struct page *page, unsigned long nodezone_num) page->flags &= ~(~0UL << NODEZONE_SHIFT); page->flags |= nodezone_num << NODEZONE_SHIFT; } +#endif #ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ extern unsigned long max_mapnr; diff --git a/xen/include/asm-ia64/time.h b/xen/include/asm-ia64/time.h index 0c6e7732e2..c3872726cf 100644 --- a/xen/include/asm-ia64/time.h +++ b/xen/include/asm-ia64/time.h @@ -1 +1 @@ -#include +#include -- 2.30.2